In this practical we will learn, how to install mysql server 5.6 on Ubuntu 14.04 LTS ( Trusty Tahr ).At the time of writing this post, MySQL Server has 5.6 version as stable release (release date – 11 April 2014).
MySQL is a open source relational database management system (RDBMS). It is popularly used in LAMP (Linux,Apache,MySQL,PHP) stack with web application. One the most reliable database and many companies are using it .
Install mysql server 5.6 on Ubuntu 14.04 LTS ( Trusty Tahr )
Installing mysql-server 5.6 is very easy. Follow the given below steps
Step 1: Install MySQL Server 5.6
Install mysql-server 5.6 with apt-get command.
sudo apt-get update sudo apt-get install mysql-server-5.6
During installation of MySQL Server packages,on your terminal you will screen of setting mysql root password. Hence, give the mysql user root password.
Given below is screenshot of screen.
Now it will again ask mysql root password for confirmation. Rewrite the same mysql root password which you have given on first screen.
Step 2 : Login into MySQL Server
After mysql server installation get finishes , it start the mysql service automatically. Hence, you can login now in MySQL Server with user root.
To login into MySQL Server, use the below given command.It will ask the mysql root password which you have set during mysql server installation.
mysql -u root -p
Given below is the reference from my server
sharad@ubuntu:~$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 36 Server version: 5.6.17-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.04 sec) mysql> exit Bye
Step 3 :MySQL Service to Start/Stop/Restart/Status
(a) To restart the mysql service
sudo service mysql restart
(b) To start mysql Service
sudo service mysql start
(c) To stop mysql service
sudo service mysql stop
(c) To get status of mysql service
sudo service mysql status
NOTE: For start/stop/restart/status of mysql , use
In case, if you are using init.d script (
/etc/init.d/mysql), it will show some error as given below.
sharad@ubuntu:~$ sharad@ubuntu:~$ sudo /etc/init.d/mysql restart * Stopping MySQL database server mysqld [ OK ] * Starting MySQL database server mysqld No directory, logging in with HOME=/ [ OK ] * Checking for tables which need an upgrade, are corrupt or were not closed cleanly. sharad@ubuntu:~$
Hence, it is good to use
service command for start/stop of mysql service