这次数据库在服务器上,从本地客户端连接就是被拒绝。
报的错误为 error 1130: host ’192.168.5.3’ is not allowed to connect to this mysql server www.bitscn.com 查过资料后发现这个问题,一般都会遇到,mysql数据库跟其他数据库不一样,需要设置权限可以控制哪台机器能访问数据库,能访问哪些表。 所以就要登上服务器。 c:\documents and settings\administrator>mysql -h localhost -u root -p enter password: *** welcome to the mysql monitor. commands end with ; or \g. your mysql connection id is 5 server version: 5.1.43-community mysql community server (gpl) type 'help;' or '\h' for help. type '\c' to clear the current input statement. www.bitscn.com mysql> grant all privileges on *.* to root@'%' identified by '123' with grant -> option; query ok, 0 rows affected (0.00 sec) 意思就是将服务器上的所有资源都给root用户权限,%代表来自不同的ip 这里需要注意一下要把密码也要带上。通过密码123登录。 mysql> flush privileges; query ok, 0 rows affected (0.00 sec) 最后要刷新下权限。 这样就从本地192.168.5.3这个ip的客户端连接到服务器上了
