1.连接MySQL
#mysql-uroot-proot
2.登录mysql数据库
MariaDB[(none)]>usemysql;
3.更改远程连接设置
MariaDB[mysql]>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1234567' WITH GRANT OPTION;
例如:指定访问demo数据库
MariaDB[mysql]>GRANT ALL PRIVILEGES ONdemo.* TO 'root'@'%' IDENTIFIED BY '1234567' WITH GRANT OPTION;
4.生效修改的权限
MariaDB[mysql]>flushprivileges;
5.查看修改结果
MariaDB[mysql]>selecthost,userfromuser;
更多关于云服务器,域名注册,虚拟主机的问题,请访问西部数码官网:www.west.cn