Install MySQL (MariaDB)

yum install mariadb-server mariadb
systemctl start mariadb
mysql_secure_installation

mysql_secure_installation prompts:
Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

New password: password
Re-enter new password: password
Password updated successfully!
Reloading privilege tables..
... Success!

systemctl enable mariadb

/etc/my.cnf

[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci

systemctl restart mariadb

create database imoocc;
grant all on imoocc.* to imoocc@'%' identified by '123456';
flush privileges;
原文地址:https://www.cnblogs.com/anyux/p/11918896.html