Saturday, 30 November 2019

How to Install MySQL Community Server 8 on CentOS 8 [MySQL Repo]



MySQL Community Server is a free and open source version of MySQL Database management System. It is widely used for database management in LAMP stack like servers and used in web applications to store and retrieve data from database.

This article describes How to Install MySQL Community Server 8 on CentOS 8.

Step 1. Setup MySQL Repository: Run the following command to setup MySQL official repository:

[root@linuxcnf ~]# dnf install https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm -y
……………………
Installed:
  mysql80-community-release-el8-1.noarch

Complete!
[root@linuxcnf ~]#

Step 2. MySQL Packages Installation: Run the following command to install MySQL Community Server and it’s dependencies from MySQL official repository:

[root@linuxcnf ~]# dnf install mysql-community-server -y --disablerepo=AppStream
…………………….
Installed:
  mysql-community-server-8.0.18-1.el8.x86_64
…………………
  mysql-community-common-8.0.18-1.el8.x86_64
  mysql-community-libs-8.0.18-1.el8.x86_64

Complete!
[root@linuxcnf ~]#

Step 3. Start MySQL Service: Run the following commands to start the MySQL Server and enable services to auto start on reboot:

[root@linuxcnf ~]# systemctl enable mysqld; systemctl start mysqld
[root@linuxcnf ~]#

Step 4. Get Temporary Password: Run the following command to grep temporary password from MySQL Log file /var/log/mysqld.log

[root@linuxcnf ~]# cat /var/log/mysqld.log |grep password
2019-11-26T17:19:44.183733Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: e8%qp0frxdUl
[root@linuxcnf ~]#

Step 5. Verify the installation: Run the following command to check installation by check installed version of MySQL Server:

[root@linuxcnf ~]# mysql --version
mysql  Ver 8.0.18 for Linux on x86_64 (MySQL Community Server - GPL)
[root@linuxcnf ~]#

[root@linuxcnf ~]# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.18
……………………
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit
Bye
[root@linuxcnf ~]#

Done!!! MySQL Community Server 8 is installed successfully on CentOS8.

No comments:

Post a Comment