I want to install the latest MYSQL 8.0 version on CentOS 7 server. How can I??
MySQL = ‘My’ is the name of the co-founder
Michael Widenius’s daughter. ‘SQL’ is the abbreviation for the Structured Query Language.
MySQL is an open source RDMS (Relational database Management System). In this article, you will know step by step how to install the latest MySQL 8.0 version on CentOS 7 server.
For this follow these steps:
1. Add Repository for MySQL
2. Install MySQL 8.0 Version
3. Start MySQL Service
4. Secure Server
5. Connect with MySQL Server.
Step 1. Add Repository for MySQL
Here we are using official MySQL YUM repository. Download and add the MySQL YUM Repository to install MySQL 8.0 version.
# wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
wget command download the MySQL Yum repository and now need to install these downloaded repository package.
# yum localinstall mysql80-community-release-el7-1.noarch.rpm
After installing the repository package, this will also add the MySQL YUM Repository to the linux system. You can check the added newly repository.
# yum repolist enabled | grep "mysql"
Step 2. Install MySQL 8.0 Version
Run the following command to install the MySQL 8.0 version.
# yum install mysql-community-server
Above command will install the packages mysql-community-common, mysql-community-libs, mysql-community-client and mysql-community-server.
Step 3. Start MySQL Service
After successfull installation of MySQL 8.0, start the mysql service
# service mysqld start
To check the mysql service status:
# service mysqld status
You can also verify the installed mysql version by running following command.
# mysql --version
Step 4. Secure Server
As in MySQL 8.0 or later version creates the temporary password in the file /var/log/mysqld.log. Grep the password from this path before running the MySQL secure installation.
# grep 'temporary password' /var/log/mysqld.log
To secure MySQL need to run the mysql_secure_installation and this will allow us to set the root password, remove anonymous users etc.
Need to enter the temporary password of mysql user root to start the mysql secure installation. And it will ask to change the password, set a new password as shown in below snapshot.
Now follow the step by step instructions and secure the sql server as done by the following steps:
- Remove anonymous users? Y
- Disallow root login? Y
- Remove test database and access to it? Y
- Reload the privilege tables now? Y
Sample output is shown below:
Step 5. Connect with MySQL Server
To connect MySQL server with user ‘root’, run this command.
# mysql -u root -p
Read: remove mysql completely from centos 7.
Finally, you have installed MySQL 8.0 on CentOS 7 server and secured MySQL server.