MySQL中root远程连接_MySQL
程序员文章站
2022-05-24 21:38:52
...
bitsCN.com
Create USER 'itpro'@'%' IDENTIFIED BY '123';
1、d:/mysql/bin/>mysql -h localhost -u root
//这样应该可以进入MySQL服务器
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION
//赋予任何主机访问数据的权限
3、mysql>FLUSH PRIVILEGES
//修改生效
4、mysql>EXIT
//退出MySQL服务器
这样就可以在其它任何的主机上以root身份登录啦!
作者“兄弟无间”
bitsCN.com上一篇: 取得随机字符串