logo
. . .

How to Install MySQL or MariaDB on Centos 7.

Install MySQL on CentOS 7…

Step 1: Update the System.
# [ sudo yum update ]

Step 2: Install MySQL.
#
[ sudo yum install mysql-server ]

Step 3: Start MySQL Service.
# [ sudo systemctl start mysqld ]

Step 4: Enable MySQL to Start on Boot.
#
[ sudo systemctl enable mysqld ]

Step 5: Secure MySQL Installation.
Run the MySQL security script to improve the default security settings.
#
[ sudo mysql_secure_installation ]
Follow the prompts to set a root password and adjust other security options.

Install MariaDB on CentOS 7:

Step 1: Update the System.
# [ sudo yum update ]

Step 2: Install MariaDB.
# [ sudo yum install mariadb-server ]

Step 3: Start MariaDB Service.
#
[ sudo systemctl start mariadb ]

Step 4: Enable MariaDB to Start on Boot.
# [ sudo systemctl enable mariadb ]

Step 5: Secure MariaDB Installation.
Run the MariaDB security script to set a root password and secure the installation.
#  [ sudo mysql_secure_installation ]
Follow the prompts to set a root password and adjust other security options.