1.改表法。
请使用mysql管理工具,如:sqlyog enterprise
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑使用mysql管理工具登入mysql后,更改 mysql 数据库里的 user 表里的 host 项,从localhost改称%
2. 授权法。
a:你想mysql账户myuser使用密码mypassword从任何主机连接到mysql服务器的话,那就在mysql命令行下输入:
grant all privileges on *.* to 'myuser'@'%' identified by 'mypassword' with grant option;
若上面那条命令还没有奏效,那就使用下面的命令,一定成功!
如果你想允许想mysql账户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码,那就在mysql命令行下输入:
grant all privileges on *.* to 'myuser'@'192.168.1.3' identified by 'mypassword' with grant option;