Installing MariaDB (MySQL) on CentOS 7
Installing MariaDB on CentOS 7 is a quick and easy process. Follow this guide and it will be done in under five minutes.
Instructions
-
First, let's install the server and client:
yum install -y mariadb mariadb-server
-
Second, enable the service to start at boot and start it manually now:
systemctl enable mariadb systemctl start mariadb
-
Look at that – MariaDB is installed already! Onto the configuration. Run this as root.
mysql_secure_installation
The script will ask you for the current password (which is none so hit Enter). The script will then have you set the new root password, remove anonymous users (if you want), disallow root login remotely (if you want), remove the test database (if you want), and lastly, to reload privileges (which you must do).
-
After the script exits, you should be able to connect:
mysql -u root -p Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 11 Server version: 5.5.52-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>