- 添加repo
vi /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64
gpgkey=http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum install mariadb mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation #回车
或者
mysql -u root -p
在mysql控制台执行
GRANT ALL PRIVILEGES ON *.* TO "root"@"%" IDENTIFIED BY "lren.org" WITH GRANT OPTION;
FLUSH PRIVILEGES;
/etc/my.cnf
[mysqld]
port = 3336
systemctl restart mariadb