1、先新增加一个MariaDB.repo
vi /etc/yum.repos.d/MariaDB.repo [mariadb]
name = MariaDB
baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos6-amd64/
gpgkey = http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=
CentOS7
[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=
官网地址特别慢,所以换了一个中国科学技术大学的镜像地址
2、开始用YUM安装MariaDB
yum install -y MariaDB-server MariaDB-client
3、启动
service mysql start
4、增加root用户
mysqladmin -u root password ''
5、增加权限
mysql -uroot -p123456 GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "";
flush privileges;