• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

AI, Linux, Cloud and DevOps

  • Home
  • Resources
    • Learn Linux
    • Articles
  • My Projects & Work
    • My Nagios Plugin
    • My Dockerhub Repo
    • My WordPress plugins
    • My Github Repos
  • Facebook Page
  • Contact
  • Privacy Policy
  • About Me
You are here: Home / mysql / How to install mysql server 5.6 on Ubuntu 14.04 LTS ( Trusty Tahr )

How to install mysql server 5.6 on Ubuntu 14.04 LTS ( Trusty Tahr )

May 7, 2014 by Sharad Chhetri 21 Comments

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.

mysql Ubuntu 14.04

Now it will again ask mysql root password for confirmation. Rewrite the same mysql root password which you have given on first screen.

MySQL Server 5.6 Ubuntu 14.04

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 service command.

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

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • More
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon

Articles

How to install MySQL Server 5.7 on Ubuntu 14.04 LTS
create and delete user in Red Hat and CentOS
Install MariaDB Server 10 on CentOS 7 and RHEL 7 by using yum
How to configure vsftpd server with virtual user mysql authentication in CentOS 6
How to setup LAMP stack on Ubuntu 14.04 LTS Server
How to configure multiple mysql instance in Ubuntu
Beginners 4 basic commands of database in mysql server
How To Solve Forgot MySQL / MariaDB Root Password
Install MariaDB Server on CentOS 7 / RHEL 7
How to change mysql default data directory in Ubuntu
Find installed and enabled apache module in Debian/Ubuntu
How to install wordpress on LAMP stack ( Ubuntu 14.04 LTS Server )
Install Owncloud 7 on Ubuntu 14.04 LTS Server
How to upgrade Mariadb 5.5 to Mariadb 10.0 on CentOS 7 / RHEL 7
Setup MySQL master slave replication in CentOS 6

Filed Under: mysql Tagged With: mysql

Reader Interactions

Comments

  1. ERandall says

    May 20, 2015 at 7:13 am

    Sharad,

    I used the instructions from the MySQL website which told me to “chown -R mysql .” my installation directory. That directory was ‘/usr/bin’. Has anyone else lost root ownership of their commands (including ‘sudo’, of course), and, if anyone recovered from this, how?

    Stupidly,

    ERandall

    Reply
    • ERandall says

      May 20, 2015 at 4:55 pm

      I got myself out of the ownership problem with a PartedMagic rescue disk. But I still have the issue of changing the ownership of the MySQL specific /usr/bin/ files. Can I uninstall and then re-install into a /usr/bin/mysql folder? Using apt-get?

      ERandall

      Reply
      • sharad chhetri says

        May 20, 2015 at 6:05 pm

        Hi ERandall,

        Yes please , try with re-installing the MySQL server.

        Regards
        Sharad

        Reply
  2. Wellington Pereira de Carvalho says

    May 18, 2015 at 2:29 pm

    Thanks a ton, guy! 😀
    I had a tough time looking or installing MySQL for programming classes.

    You helped me and a lot of people, good sir!
    Thank you so much!

    Sincerely,
    Wellington

    Reply
  3. felix cama says

    March 26, 2015 at 10:17 am

    “Cannot start SSH tunnel manager” , when try input in worbench..¿

    Reply
    • sagul kv says

      October 31, 2016 at 12:34 pm

      thanks i got it..

      Reply
  4. Amar Mujumdar says

    March 2, 2015 at 12:16 pm

    Hi Sharad,

    Thanks for the link.

    where the config file is stores if i had install mysql locally in ubuntu using apt-get.

    –Amar

    Reply
    • sharad chhetri says

      March 2, 2015 at 2:16 pm

      Hello Amar,

      You can get the configuration files at /etc/mysql/

      Regards
      Sharad

      Reply
  5. Lara says

    February 17, 2015 at 2:31 am

    Thanks for the great article, Sharad! I needed to install MySQL for a database class, but I had just switched to Ubuntu from Windows and was completely lost before finding your tutorial. This method worked PERFECTLY and I’m excited to get to work. Thanks again!

    All the best,
    Lara

    Reply
    • sharad chhetri says

      February 18, 2015 at 1:54 am

      Hello Lara,

      First of all thanks to you also, getting feedback on article is very important for author.
      + I am very happy to see the post is helping to all. Keep reading our blog and share your ideas with others too.

      Regards
      Sharad

      Reply
  6. niceguy says

    February 7, 2015 at 4:55 am

    Thanks a lot dude.

    Reply
  7. Rahul Kini says

    December 6, 2014 at 3:10 pm

    Thanks… That worked… 🙂
    Had a tough time searching the web for this article…

    Reply
    • sharad chhetri says

      December 7, 2014 at 5:46 am

      Awesome !!
      Thankyou for giving us the feedback. It helps other users too.

      Regards
      Sharad

      Reply
  8. Flávio Mariano says

    November 21, 2014 at 12:36 am

    Thanks very much, after much time trying install from apt-get-install mysql-server, I got.

    Reply
    • sharad chhetri says

      November 21, 2014 at 6:45 pm

      You are welcome Flavio. Highly appreciate your feedback, make me feel good and boost me to write more useful post.

      Regards
      Sharad

      Reply
  9. Felipe says

    July 17, 2014 at 7:54 pm

    Hello,
    I had installed mysql 5.5 in my ubuntu 14.04, which is the best or
    more correct way to upgrade to 5.6 without losing the data I already
    have in my database?

    regards,
    Felipe.

    Reply
    • sharadchhetri says

      July 18, 2014 at 12:48 pm

      Hello Felipe,

      First take the backup of mysql with mysqldump command. Most important thing is in MySQL 5.6 version , new parameter have been introduced. Best way is take the backup of MySQL, restore it in some test server and then upgrade the MySQL version. By this way you will get to know what are the changes and issue you may face while on upgradation.

      Regards
      Sharad

      Reply
  10. mar says

    May 17, 2014 at 5:14 pm

    Hello, some days ago I sent you an email about your post about the mysql server. Reading this post I have a doubt, I don’t know if I have to install the mysql server first and the mysql workbench in second place, or is really not important the order in the installation. I’m currently using Ubuntu 14.04.
    I will be very thankful for your answer.

    Best regards.

    Reply
    • sharad chhetri says

      May 18, 2014 at 2:44 am

      Hello Mar,

      Apologize, I have been again out of my city due to official reason. Since in these time, I did not get chance to check the email.

      The order of installation do not matter. MySQL Wordkbench is just simply a tool which helps to connect with MySQL Server and helps to work on awesome stuffs.

      Regards
      Sharad

      Reply
Newer Comments »

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Articles

  • Install n8n docker in Ubuntu for practicing
  • Bash Script: MySQL Database backup to AWS S3
  • Automate no touch Jenkins setup wizard on docker (jcac)
  • How to run and configure Jenkins in Docker container
  • Complete Guide: How to install Nagios Monitoring on AlmaLinux / Rocky Linux
  • Install KVM on Ubuntu 24.04 LTS ( Bash Script )
  • How to install GIMP 2.10 on Ubuntu / Debian
  • 5 ways to check Ubuntu version of system (commands and GUI)
  • How To Solve Forgot MySQL / MariaDB Root Password
  • Create Self Hosted Build Agent Docker Image for Azure DevOps

Copyright © 2026 ·
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From India.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy