MariaDB安装教程

MariaDB Installation tutorial

Posted by 王灿辉 on 2020-02-23

1.在CentOS上安装Mariadb

使用yum安装mariadb mariadb-devel mariadb-server

1
sudo yum install -y mariadb mariadb-devel mariadb-server

2.启动服务

启动服务的同时设置开机自动启动

1
2
sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

3.设置密码

初次登陆mysql是没有密码的,输入下面的命令在输入密码的地方继续回车即可

1
mysql -uroot -p

4.配置权限

接下来要设置root用户的密码,并赋予相应权限

1
2
3
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;


赞赏支持
微信赞赏
微信赞赏
支付宝
支付宝