使用yum源安装。
1
|
yum install mariadb-server.x86_64
|
设置开机启动和启动
1
2
3
|
# systemctl start mariadb
# systemctl enable mariadb
# systemctl status mariadb
|
进行安全设置
1
|
mysql_secure_installation
|
错误处理
连接局域网上的MySQL时报错
ERROR 1130 (HY000): Host '192.168.2.1' is not allowed to connect to this MySQL server
解决办法
在mysql所在机器上,进行授权。
登录MySQL
1
|
mysql -uroot -p
|
切换到mysql数据库
1
|
use mysql
|
授权
1
2
|
GRANT ALL PRIVILEGES ON *.* TO 'root' @ '%' ;
FLUSH PRIVILEGES ;
|