mysql 报错 Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
Mac版, 数据库莫名报错
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
尝试重新安装最新版本的数据库,8.0
。并未解决。
解决方案:
1.cmd
打开到mysql
下:
cd /usr/local/mysql/bin
2.运行mysqld
, 报错如下:
2021-12-23T06:25:39.163473Z 0 [ERROR] [MY-000077] [Server] /usr/local/mysql-8.0.27-macos11-x86_64/bin/mysqld: Error while setting value 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.
2021-12-23T06:25:39.163510Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-12-23T06:25:39.163574Z 0 [Note] [MY-010120] [Server] Binlog end
3.初步定位是在设置值的时候,出现的了错误。
查看其他博客,定位问题在 Mysql 8.0以上已经取消了NO_AUTO_CREATE_USER
这个关键字,windows