在CentOS下安装Mariadb 数据库,命令:
yum -y mariadb mariadb.server
等待几分钟后就可以自动完成安装了,然后启动对应的服务:
systemctl start mariadb.service 或 systemctl start mariadb
设置开机启动:
systemctl enable mariadb
然后配置相关设置:
mysql_secure_installation
设置完成后,设置容许远程链接:
mysql -uroot -p123456
grant all privileges on *.* to 'root'@'192.168.*.*' identified by 'root' with grant option;
flush privileges;
再次尝试链接,还是不行,然后再修改:
update user set host = '%' where user = 'root';
flush privilegs;
再次链接成功了。