mysql连接报错 Lost connection to MySQL server at 'sending authentication information', system error: 32

如果mysql连接报错Lost connection to MySQL server at 'sending authentication information', system error: 32

一种可能的原因是系统打开文件数过多

mac系统默认是256个,如果数据库打开文件过多,会因为系统限制而报错。

解决方案有两种:

1. 修改mysql配置,默认是一个表一个文件,可以修改为一个库一个文件

修改mysql配置文件/etc/my.cnf,添加如下配置,删除原来的数据库重新生成,记得提前dump数据

[mysqld]
innodb_file_per_table = OFF

2. 修改系统最大文件数

mac系统执行如下命令

sudo launchctl limit maxfiles 65536 200000

 

posted @ 2020-02-26 19:29  宇的季节  阅读(2104)  评论(0编辑  收藏  举报