1.连接MySQL
# mysql -uroot -proot
2.登录mysql数据库
MariaDB [(none)]> use mysql;
3.更改远程连接设置
MariaDB [mysql]>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1234567' WITH GRANT OPTION;
例如:指定访问demo数据库
MariaDB [mysql]>GRANT ALL PRIVILEGES ON demo.* TO 'root'@'%' IDENTIFIED BY '1234567' WITH GRANT OPTION;
4.生效修改的权限
MariaDB [mysql]> flush privileges;
5.查看修改结果
MariaDB [mysql]> select host,user from user;
Copyright © 2013-2021 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号