Tuesday, 18 August 2020

How to Install MySQL 8.0 Database Server on CentOS 8 [AppStream Repo]




MySQL is a popular open-source database and community version of MySQL database, it is widely used for database management in LAMP stack like servers.

This article describes, How to Install MySQL 8.0 Database Server on CentOS 8.

Step 1. Package installation: All MySQL Database and its dependencies packages are available in CentOS 8 AppStream Repository so just run the following command to install to install MySQL packages:

[root@linuxcnf ~]# dnf install mysql-server
CentOS-8 - AppStream
……………………..
Installed:
  mysql-server-8.0.17-3.module_el8.0.0+181+899d6349.x86_64

Complete!
[root@linuxcnf ~]#

Step 2. Start MySQL Service: Run the following commands to start the server and enable on startup:

[root@linuxcnf ~]# systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service /usr/lib/systemd/system/mysqld.service.
[root@linuxcnf ~]#

Step 3. Verify the installation: Check the service status and check MySQL Database by access its interactive interface:

[root@linuxcnf ~]# systemctl status mysqld
mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-08-18 10:07:47 EDT; 5s ago
  Process: 5126 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
……………………..
[root@linuxcnf ~]#

Run the following command to enter in MySQL interface:

[root@linuxcnf ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.17 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Bye
[root@linuxcnf ~]#

Done!!! MySQL Database is installed successfully. Use \q command to exit from the interface.

No comments:

Post a Comment