Install MySQL Database server in Ubuntu

February 15, 2012 in MySQL

Install MySQL Database server in Ubuntu / Debian

What is MySQL?

MySQL is most popular open source database. It is a high performance and reliable database and it is easy to use. MySQL runs on almost all known Operating Systems including Ubuntu.

How to install MySQL on Ubuntu 11.04

You can install MySQL Server from the terminal. Just type:

$> sudo apt-get install mysql-server

To install MySQL client just use the Following command

$>sudo apt-get install mysql-client

Or you can install both of them at once by typing:

$>sudo apt-get install mysql-server mysql-clinet

while the installation is in progress a screen like the following will appear and ask you for a password for MySQL root user. Please be sure to type something that you will not forget because you will need that to grand access to MySQL.

After pressing ok MySQL installation will ask you to retype the password for MySQL root user.

If you are going to use php on you server you also have to install PHP for MySQL by typing the following:

$>sudo apt-get install php-mysql

Congratulations now you have MySQL server up and running on your system.

If you want to access MySQL console just type

$>mysql -u root -p

Enter your MySQL root password and you are in the MySQL console

Here is a video tutorial on how to install MySQL on Ubuntu 11.04