首页 > 代码库 > sqlyog连centos中xmapp下mysql。

sqlyog连centos中xmapp下mysql。

3.虚拟机centos,用xampp集成安装mysql后,本机用sqlyog连时,错误:

错误代码 1130:Host ‘192.168.0.1’ is not allowed to connect to this mysql server

2.虚拟机用登录mysql,错误:

ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)


 

1.[root@centos0 htdocs]# find / -name mysql.sock
/opt/lampp/var/mysql/mysql.sock

0.[root@centos0 run]# ln -s /opt/lampp/var/mysql/mysql.sock /var/lib/mysql/mysql.sock


2.虚拟机可以登录mysql

3.本机再次sqlyog连时,仍有报错

4.参考百度的解决办法:“登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"”

5.mysql> update user set Host=‘%‘ where user=‘root‘;
ERROR 1062 (23000): Duplicate entry ‘%-root‘ for key ‘PRIMARY‘

6.参考百度的解决办法:select * from user where Host=‘%‘;  有一个%的记录。

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

7.本机再次sqlyog连时,connection successful!!!

sqlyog连centos中xmapp下mysql。