宝塔的mysql配置root访问

1、mysql -uroot -p123456

2、use mysql

3、接着授权 grant all on *.* to 'root'@'%' with grant option;

4、刷新配置 flush privileges;

5、查看效果 select host, user, authentication_string, plugin from user;

6、重启mysql

如果是宝塔,需要执行以上命令后,再在宝塔里设置root的密码,即可

sql语句最后的“;”不可以少

猜你喜欢

转载自blog.csdn.net/nocoah/article/details/130907230