How do I connect to a database on a Linux virtual server?

To connect to MySQL and MariaDB databases on Linux virtual servers, use a tool like MySQL Workbench (cross-platform), or Sequel Pro (macOS). Both are free applications. Note: This does not include databases hosted by the Technology Solutions database service, which are accessed using a different process.

MySQL Workbench Setup

Download

  1. Visit MySQL Workbench download page.

    My S Q L Workbench start window
     
  2. Select your platform and click the Download button.

    start download button
     
  3. On the next page, click "No thanks, just start my download" link to start your download. Install as you would other software on your computer.

 

Configure

  1. Open MySQL Workbench and click the Plus button next to MySQL Connections to add a new connection.

    connection method field
     
  2. Enter a connection name (for example, the name of your virtual server).
     
  3. Select Standard TCP/IP over SSH as the connection method.
     
  4. In the SSH hostname, enter the server's hostname (for example foo.vm.uic.edu).
     
  5. Enter your UIC NetID as the SSH username. Use either your UIC password, or an SSH key (highly recommended) to authenticate. If authenticating with a password, do not save it here. Instead, you will be prompted for the password when you connect.
     
  6. MySQL hostname should be set to an appropriate IP or hostname if it is a remote server. 127.0.0.1 is used for the local server.
     
  7. Enter your database login credentials in the Username and Password field.

 

Connect

  1. Double-click on your new connection to connect. You may see the following message when connecting for the first time:
    SSH Server Fingerprint Missing The authenticity of host 'foo.vm.uic.edu:22 (foo.vm.uic.edu:22)' can't be established. ssh-rsa key fingerprint is 4bac1cf45430196928072b0d5623ff7f Are you sure you want to continue connecting?
  2. Click Continue.
     
  3. Once connected, you should see your databases in the Schema section:

    schema view
     
  4. Visit MySQL Workbench documentation to learn more about how to use MySQL Workbench.
     

PHPMyAdmin

PHPMyAdmin is a great tool, but there are drawbacks. It has to be installed and maintained on the virtual server. If you manage databases on more than one virtual server, the installation and maintenance will start taking up more of your time.

As a server-side application, it also poses a security risk. Logs show that many of our virtual servers are regularly polled for existence of "/phpmyadmin" and variations. Though you can limit the risk by crafting a special URL to access PhpMyAdmin, a desktop tool poses less risk and does not require as much maintenance.

Print Article

Related Services / Offerings (1)

A Virtual Machine is a guest server hosted on a VM host.