Thursday, July 9, 2009

Install and setup MySQL on Ubuntu Jaunty

Here is how I installed MySQL 5.1 Community Edition on Ubuntu Jaunty:

1. Install MySQL

Goto Synaptic Package Manager and in quick search type 'mysql-server-5.1' (without quotes). From the list that will be provided, choose to install package with name mysql-server-5.1. It will show you all the dependencies and proceed to install.

Alternately you can use apt-get command.

sudo apt-get install mysql-server-5.1

1a. During the installation it will prompt for a password. Enter password of your choice.

1b. Confirm the password. Make sure installation completes successfully

2. Test the installation

To test the installation, type the following in Terminal.

mysql --user=root --password=yourpassword

"Welcome to the MySQL monitor. Commands end with ; or \ g.
Your MySQL connection id is 53
Server version: 5.1.31-1ubuntu2 (Ubuntu)

Type 'help;' or '\ h' for help. Type '\ c' to clear the buffer."

After this you should be able to see the prompt change to

mysql>

3. Use the mysql database.

mysql> use mysql;

"Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed"

4. Now see the tables present in the database

mysql> show tables;

This will display all the tables present in the database.

MySQL has been successfully installed.

In the next post I ll show how I configured Eclipse to talk to MySQL!

No comments:

Post a Comment