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

Posted 宇的季节

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql连接报错 Lost connection to MySQL server at 'sending authentication information', system er相关的知识,希望对你有一定的参考价值。

如果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

 

以上是关于mysql连接报错 Lost connection to MySQL server at 'sending authentication information', system er的主要内容,如果未能解决你的问题,请参考以下文章