Hostwinds Tutorials

Search results for:


Table of Contents


How to install MySQL in Ubuntu 14.04
MySQL 5.5 or 5.6
MySQL 5.7

How to Install MySQL in Ubuntu 14.04

Tags: MySQL,  Ubuntu 

How to install MySQL in Ubuntu 14.04
MySQL 5.5 or 5.6
MySQL 5.7

MySQL is a prevalent open-source database management system that you'll typically find in a Linux server environment as part of a LAMP stack. MySQL is used by several large companies across the internet, such as Facebook and YouTube, to store various bits of pertinent data. MySQL can also be used when working with content management systems such as Joomla or WordPress, which you can use to create a stylish website. This article will walk you through the process of installing MySQL in Ubuntu 14.04.

How to install MySQL in Ubuntu 14.04

A few things to consider when installing MySQL in Ubuntu 14.04, primarily what version of MySQL you'd like to use. You can either install the version included by default in the APT repository (5.5 or 5.6), or you can manually add MySQL's repository directly and install the latest version. This decision is solely up to you and your specific needs/requirements. However, if you're not certain, you can always use the version available through the APT repository, as this will be the most recent version available for your distro. Before we get started, you'll need to have access to your server, and you'll need to log in via SSH as the root user. If you're not certain how to access your server using SSH, please refer to the following article: Connecting to Your Server via SSH.

To install the most recent MySQL version for your particular distro, you should first update your server's package index and then perform the installation using apt-get.

apt-get update
apt-get install mysql-server

During the installation process, you will be asked to enter your MySQL password.

To finalize the installation, you'll need to run the security script that is included with MySQL. This script will allow you to change some of the default options, which are typically less secure:

mysql_secure_installation

MySQL 5.5 or 5.6

If you'd like to install MySQL version 5.5 or 5.6 specifically, you'd issue either of the following commands:

apt-get install mysql-server-5.5

Or

apt-get install mysql-server-5.6

Regardless of which version you decide to install, you'll be prompted to create the MySQL root password during the installation. Please be sure to keep this password handy, as you may need it a bit later.

MySQL 5.7

To install MySQL version 5.7, you'll need to add the MySQL repository, update the server's package index, and finally install MySQL 5.7. This process can be accomplished by using the following sequence of commands:

wget http://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb
dpkg -i mysql-apt-config_0.6.0-1_all.deb
apt-get update
apt-get install mysql-server

To finalize the installation, you'll need to run the security script that is included with MySQL. This script will allow you to change some of the default options, which are typically less secure:

mysql_secure_installation

Last but not least, if you're using a version of MySQL less than 5.7.6, you'll need to initialize the data directory by using the following command:

mysqld --initialize

If everything went successfully, the MySQL version of your choice should now be installed!

If you should have any questions or would like assistance, please contact us through Live Chat or by submitting a ticket with our Technical Support team.

Written by Michael Brower  /  June 22, 2017