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

Don't forget!

If you are connecting from off-campus, you must also be connected using UIC VPN. VPN installation instructions are available for Windows, Mac OS X, and Linux.

To connect to MySQL and MariaDB databases on Linux virtual servers, use a tool like MySQL Workbench (cross-platform), or Sequel Pro (Mac OS X). Both are free applications.

Download

Visit MySQL Workbench download page. Select your platform and click the Download button. 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

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

MySQL Workbench connections section

Enter a connection name (for example, the name of your virtual server).

Select Standard TCP/IP over SSH as the connection method.

In the SSH hostname, enter the server's hostname (for example foo.vm.uic.edu).

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.

MySQL hostname should be set to 127.0.0.1 (default).

Enter your database login credentials in the Username and Password field.

Your connection configuration will look similar to this:

MySQL Workbench connection configuration

Connect

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?

Click Continue.

Once connected, you should see your databases in the Schema section:

MySQL Workbench editor window

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. 

Useful links

Need help?

Last updated: 

September 20, 2016

Browse by tag