mysql实现允许外部ip访问
2013-08-06 12:47
246 查看
mysql默认情况下,只允许localhost连接,如果需要外部IP连接到mysql,需要向mysql数据库里的“user”表里添加相关授权。
1。改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改"mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmware
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY'mypassword' WITH GRANTOPTION;如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY'mypassword' WITH GRANT OPTION;
1。改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改"mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -pvmware
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>select host, user from user;
2. 授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY'mypassword' WITH GRANTOPTION;如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY'mypassword' WITH GRANT OPTION;
相关文章推荐
- mysql允许外部IP访问
- linux 下允许外部ip访问你到mysql 数据库
- 设置mysql允许外部IP访问
- 设置mysql允许外部IP访问
- 设置mysql允许外部IP访问
- 设置mysql允许外部IP访问,giant权限
- 设置mysql允许外部IP访问
- 设置mysql允许外部IP访问
- Linux 下允许外部ip访问你到MySQL 数据库
- 设置mysql允许外部连接访问
- 让apache只允许域名访问而禁止IP实现方法
- 设置mysql允许外部IP连接的解决方法
- nginx配置实例:只允许内部IP访问 禁止外部访问
- 设置mysql允许外部IP连接的解决方法
- 解决MySQL不允许(其它IP)从远程访问的方法
- mysql允许某个ip访问
- nginx配置实例:只允许内部IP访问 禁止外部访问
- 使用navicat设置mysql允许外部IP连接【1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL serve】
- mysql设置允许外部访问的方法
- mysql 添加某个ip 允许访问