mysql设置指定ip远程访问是非常的简单的,只要一条命令或者直接在phpmyadmin中就可以实现了,具体命令如下.
1.授权用户root使用密码maozhuxi123从任意主机连接到mysql服务器.
- GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'maozhuxi123' WITH GRANT OPTION;
- flush privileges;
2.授权用户root使用密码maozhuxi123从指定ip为218.12.50.60的主机连接到mysql服务器,代码如下:
- GRANT ALL PRIVILEGES ON *.* TO 'root'@'218.12.50.60' IDENTIFIED BY 'maozhuxi123' WITH GRANT OPTION;
- flush privileges; --Vevb.com
新闻热点
疑难解答