1,安装
sudo yum install mariadb mariadb-server -y
2,启动
sudo systemctl start mariadb.service
3,查看是否启动
sudo netstat -anp|grep MySQL
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 182696/mysqld
unix 2 [ ACC ] STREAM LISTENING 110926360 182696/mysqld /var/lib/mysql/mysql.sock
4,初始化root
sudo mysql_secure_installation
5,登陆mysql 操作
mysql -uroot -ppasswd
========================
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 9
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]>
可能遇到的问题,如安装不了,可能需要选择国内的镜像源
vim /etc/yum.repos.d/MariaDB.repo
[mariadb] name = MariaDB baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.1/centos7-amd64/ gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1
参考文档
https://www.cnblogs.com/AdaterCat/p/5850700.html
https://blog.csdn.net/qq_39719589/article/details/81835330