默认情况下Linux内的mysql数据库mysql.user表内的用户权限只是对localhost即本机才能登陆。所以需要更改权限,否则无法使用Mysql Administrator连接服务器,会发生如下所示的错误:
MySQL Administrator 1.1.9配置,连接mysql数据库
Could not connect to the specified instance
MySQL Error Number 1130
Host '192.168.1.51' is not allowed to connect to this MySQL server
if you want to check the net connection , please click the ping buttion
解决的方法,首先按照如下的方式确认服务器上的user表中的权限设置,执行命令:
root#mysql -h localhost-u mysql -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.20a-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql; (此DB存放MySQL的各种配置信息)
Database changed
mysql> select host,user from user; (查看用户的权限情况)
+-------------+-------+
| host | user |
+-------------+-------+
| localhost | |
| localhost | root |
| localhost | |
| localhost | mysql |
+-------------+-------+
6 rows in set (0.02 sec)
由此可以看出,目前只能以localhost的主机方式访问。解决方法就是修改权限,执行如下命令:
mysql> Grant all privileges on *.* to 'root'@'%' identified by ‘password’ with grant option;
相应参数的解释如下:
all privileges 是�