ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
安装 MySQL 完成并启动后,执行匿名用户登录语句报错。
1、匿名用户登录语句
mysql -ux3
2、报错信息
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
3、解决方案
增加软连接,命令如下:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock