Installing and Running mysql in Linux/Ubuntu

Installing and Running mysql in Linux/Ubuntu

This is short article to give basic instruction how to install mysql in Linux from terminal. First open terminal and use this command:

 sudo apt-get install mysql-server 

During the installation process you will be prompt to install root password.

After the installation process is completed you can check whether mysql server is running or not by using following command.

sudo netstat -tap | grep mysql

When you run the above command you may see the following command or similar: If the port is listening than your mysql server is running perfect.

tcp   0   0 localhost:mysql       *:*          LISTEN    20122/mysqld

If the server is not running then you may restart your server by using following command.

sudo service mysql restart

To run mysql server copy or type this command in terminal:

 mysql -u root -p 

Leave a Reply

Your email address will not be published. Required fields are marked *