Installation of MySQL
Add MySQL APT Repository
Download MySQL APT repository from http://dev.mysql.com/downloads/repo/apt/.
select package for your Linux distribution
Install the downloaded release package with the following command
shell> sudo dpkg -i mysql-apt-config_5.5.7_all.deb
During the installation of the package, you will be asked to choose the versions of the MySQL server and other components (for example, the MySQL Workbench) that you want to install. If you are not sure which version to choose, do not change the default options selected for you.
update package information from the MySQL APT repository with the following command
shell> sudo apt-get update
Install MySQL by the following command:
shell> sudo apt-get install mysql-server
During the installation, there are two requests by the dialogue boxes:Supply a password for the root user for your MySQL installation
Indicate if you want to install the test database with “Yes” or “No”. Installation of the test database is not recommended for production environments.
Starting and Stopping the MySQL Server
The MySQL server is started automatically after installation. You can check the status of the MySQL server with the following command:
shell> sudo service mysql status
Stop the MySQL server with the following command:
shell> sudo service mysql stop
To restart the MySQL server, use the following command:
shell> sudo service mysql start