Swords and Software

Setting up MySQL 5.1.41 on Ubuntu 10.04 LTS

By Daniel D'Agostino, 2010-12-04

This is a brief walkthrough on setting up MySQL for Ubuntu. The version numbers in the title indicate what I worked with, but these steps should apply to just about any version of MySQL and Ubuntu.

In short, you need to install mysql-server and mysql-admin, and set up a connection to the MySQL server that will allow you to access the databases. For the installation you need only do the following from the terminal:

sudo apt-get install mysql-server
sudo apt-get install mysql-admin
While installing the MySQL server you will be promoted to enter a root password...
While installing the MySQL server you will be promoted to enter a root password...
...twice.
...twice.

Once you have both installed, then launch the MySQL Administrator - either by running mysql-admin from the Terminal, or through the new shortcut in the Applications -> Programming menu in Ubuntu.

Open the Connection Editor.
Open the Connection Editor.
Click the Add Connection button.
Click the Add Connection button.
Fill in the details as shown.
Fill in the details as shown.

Follow the steps illustrated above to set up a connection, and then enter the details in the original login screen to access the MySQL Administrator. This is a tool that allows you to oversee the operation of the MySQL server. Login as root for full access to the services.

The MySQL Administrator.
The MySQL Administrator.

Once you have a working connection, run the MySQL Query Browser and try running a query on one of the default databases.

Access the MySQL Query Browser.
Access the MySQL Query Browser.
Login.
Login.
Run a query.
Run a query.

Once you see that the query runs (even if no rows are returned), you know that things are working, and you can start creating your own databases.