Site icon Database Tutorials

How To Install MySQL 5.7 Community on Ubuntu

 

Introduction

MySQL, the most popular Open Source SQL database management system developed, distributed, and supported by Oracle Corporation.

In this article we’ll go over the steps to install MySQL Server on your Ubuntu environment.

  1. Installed MySQ 5.7  packages
in the prompt below select MySQL Server (mysql-5.7) and press Enter

 

During the installation you will be asked to provide a password for root userID, type a secure one and make sure you remember it, because you’ll need it later.

 

II. Secure MySQL after Installation and initialize

 

This program enables you to improve the security of your MySQL installation in the following ways:
– You can set a password for root accounts.
–  You can remove root accounts that are accessible from outside the local host.
– You can remove anonymous-user accounts.
– You can remove the test database (which by default can be accessed by all users, even anonymous users), and privileges that permit anyone to access databases with names that start with test_.

 

The next step is to initialize your MySQL with command below :

 

To test your MySQL service you can run below commands

 

you can also replace status with stop, start or restart  to stop start or restart your service regardless of your situation.

to connect to your MySQL instance on CLI (command line Mode) run below command:

 

and you will be prompt to enter the root password your previously set (:

Exit mobile version