How To Install mysql on CentOS 8

mysql is MySQL client programs and shared libraries

Introduction

In this tutorial we learn how to install mysql on CentOS 8.

What is mysql

MySQL is a multi-user, multi-threaded SQL database server. MySQL is a client/server implementation consisting of a server daemon (mysqld) and many different client programs and libraries. The base package contains the standard MySQL client programs and generic MySQL files.

We can use yum or dnf to install mysql on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install mysql.

Install mysql on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install mysql using dnf by running the following command:

sudo dnf -y install mysql

Install mysql on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install mysql using yum by running the following command:

sudo yum -y install mysql

How To Uninstall mysql on CentOS 8

To uninstall only the mysql package we can use the following command:

sudo dnf remove mysql

mysql Package Contents on CentOS 8

/usr/bin/mysql
/usr/bin/mysql_config_editor
/usr/bin/mysqladmin
/usr/bin/mysqlbinlog
/usr/bin/mysqlcheck
/usr/bin/mysqldump
/usr/bin/mysqlimport
/usr/bin/mysqlpump
/usr/bin/mysqlshow
/usr/bin/mysqlslap
/usr/lib/.build-id
/usr/lib/.build-id/18
/usr/lib/.build-id/18/d603f49e05179a1fd2f197713c30427b271773
/usr/lib/.build-id/2b
/usr/lib/.build-id/2b/23b4fa8145a5c04f456018d2b893038c659906
/usr/lib/.build-id/53
/usr/lib/.build-id/53/fd8f6ca57a98da5c16e3bcdaa4c9b4c1858bf6
/usr/lib/.build-id/66
/usr/lib/.build-id/66/0d20d31efea5bc341a6a52ee71fb5bb4bdc7f3
/usr/lib/.build-id/ba
/usr/lib/.build-id/ba/90fd7ad62b3256f15c61fb38217096fffc27b6
/usr/lib/.build-id/c6
/usr/lib/.build-id/c6/f74a584081c3ff026c4666b2b404a5fe4a98bb
/usr/lib/.build-id/cf
/usr/lib/.build-id/cf/15a43d04cf4f1f79a1221d905c8ad04c03c51c
/usr/lib/.build-id/df
/usr/lib/.build-id/df/86f10f299efbb29b17cad226ec1c4fba437c80
/usr/lib/.build-id/fa
/usr/lib/.build-id/fa/b96bb71638a0e3ca6331748090631ef1ee89c2
/usr/lib/.build-id/fd
/usr/lib/.build-id/fd/9f40c543a24fbc8f9bd9462e201dce0e661546
/usr/share/man/man1/mysql.1.gz
/usr/share/man/man1/mysql_config_editor.1.gz
/usr/share/man/man1/mysqladmin.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man1/mysqldump.1.gz
/usr/share/man/man1/mysqlimport.1.gz
/usr/share/man/man1/mysqlpump.1.gz
/usr/share/man/man1/mysqlshow.1.gz
/usr/share/man/man1/mysqlslap.1.gz

References

Summary

In this tutorial we learn how to install mysql on CentOS 8 using yum and dnf.