Thursday, 25 October 2018

How To Install MySQL on Ubuntu 16.04

MySQL is an open-source database management system, commonly installed as part of the popular LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.
The short version of the installation is simple: update your package index, install the mysql serverpackage, and then run the included security script.
sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation
This tutorial will explain how to install MySQL version 5.7 on a Ubuntu 16.04 server. However, if you're looking to update an existing MySQL installation to version 5.7, you can read this MySQL 5.7 update guideinstead.

Steps for Installation

You will need to follow the following steps:

STEP 1 : Installing MySQL

On Ubuntu 16.04, only the latest version of MySQL is included in the APT package repository by default. At the time of writing, that's MySQL 5.7 To install it, simply update the package index on your server and install the default package with apt-get.
sudo apt-get update
sudo apt-get install mysql-server

You'll be prompted to create a root password during the installation. Choose a secure one and make sure you remember it, because you'll need it later. Next, we'll finish configuring MySQL.

STEP 2 : Configuring MySQL

For fresh installations, you'll want to run the included security script. This changes some of the less secure default options for things like remote root logins and sample users. On older versions of MySQL, you needed to initialize the data directory manually as well, but this is done automatically now.
Run the security script.
mysql_secure_installation
This will prompt you for the root password you created in Step 1. You can press Y and then ENTER to accept the defaults for all the subsequent questions, with the exception of the one that asks if you'd like to change the root password. You just set it in Step 1, so you don't have to change it now. For a more detailed walkthrough of these options, you can see this step of the LAMP installation tutorial.

STEP 3 : Testing MySQL

Regardless of how you installed it, MySQL should have started running automatically. To test this, check its status. You'll see output similar to the following:


In case, if You'll not see output similar to the above. Please try
sudo mysql_secure_installation
Thats it....Lets Enjoy..... 😆



Related Posts:

0 comments:

Post a Comment