is not allowed to connect to this Mysql server解决

demo

我用Navicat这个工具在里面建立一个远程连接,但总是提示我这个错误:
1130-Host”…” is not allowed to connect to this MySQL server

问题是mysq服务器没有开启远程访问的权限,注:未开启情况下phpmyadmin是可以访问的。

具体开启方式如下:

C:Documents and Settingslyt>cd C:Program FilesMySQLMySQL Server 5.0bin

C:Program FilesMySQLMySQL Server 5.0bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2 to server version: 5.0.27-community-nt

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> grant all privileges on *.* to ‘lyt’@’%’ identified by ‘lyt';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
以上操作完成后不重启服务器即可以访问了。

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress