报错如下:

MySql 5.7 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

报错的原因:MySQL-client将sock文件放在/tmp目录,而MySql-server端将其放在自己指定/mysql目录。所以我们只需要创建一个软链接,将开启mysqld生成的 mysql.sock链接到 /tmp/mysql.sock
MySql 5.7 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

解决方法
[[email protected] ~]# ln -s /usr/local/mysql/mysql.sock /tmp/mysql.sock
MySql 5.7 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

相关文章:

  • 2021-07-25
  • 2021-08-23
  • 2021-06-28
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2021-05-24
  • 2021-06-12
  • 2021-04-23
相关资源
相似解决方案