1.通过navicat或者命令行,将user表中原来host=localhost的改为host=%
命令行方式:
mysql> update user set host = ‘%‘ where host= ‘localhost‘;
2.授权访问给root用户
mysql>grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘password‘ with grant option;
3.刷新mysql的权限配置
mysql> flush privileges;
时间: 2024-11-04 08:11:50