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