mysql 无法启动,报too many connections,实际情况是磁盘满了,mysql无法启动造成的

今天以前负责的一个网站,突然无法启动,因为是thinkphp写的,打开网站直接报错出现too many connections, 网上查了一下,说是连接数少了,还有说可能是ddos攻击了。但是然后使用mysql -u user -p password 这样使连不上mysql数据库的,你发现连mysql也无法重启,无法启动。这个时候比较纳闷,无法启动,无法重启,很无奈。只能查看错误日志,首先找到你的mysql错误日志,看报什么错误。一开始并没有什么有用的信息。启动mysql也没有反应。

日志出现

80520 19:39:42 InnoDB: The InnoDB memory heap is disabled
180520 19:39:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180520 19:39:42 InnoDB: Compressed tables use zlib 1.2.3
180520 19:39:42 InnoDB: Initializing buffer pool, size = 128.0M
180520 19:39:42 InnoDB: Completed initialization of buffer pool
180520 19:39:42 InnoDB: highest supported file format is Barracuda.
180520 19:39:43  InnoDB: Waiting for the background threads to start
180520 19:39:44 InnoDB: 1.1.8 started; log sequence number 3240483408
180520 19:39:44 [Note] Recovering after a crash using mysql-bin
180520 19:39:44 [ERROR] Error in Log_event::read_log_event(): 'read error', data_len: 117, event_type: 2
180520 19:39:44 [Note] Starting crash recovery...
180520 19:39:44 [Note] Crash recovery finished.
^G/usr/local/mysql/bin/mysqld: Disk is full writing './mysql-bin.~rec~' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space)
^G/usr/local/mysql/bin/mysqld: Retry in 60 secs. Message reprinted in 600 secs
180520 19:49:52 InnoDB: The InnoDB memory heap is disabled
180520 19:49:52 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180520 19:49:52 InnoDB: Compressed tables use zlib 1.2.3
180520 19:49:52 InnoDB: Initializing buffer pool, size = 128.0M
180520 19:49:52 InnoDB: Completed initialization of buffer pool
180520 19:49:52 InnoDB: highest supported file format is Barracuda.
180520 19:49:52  InnoDB: Waiting for the background threads to start
180520 19:49:53 InnoDB: 1.1.8 started; log sequence number 3240483408

180520 19:49:53 [Note] Recovering after a crash using mysql-bin

这个错误我搜了一下,并没有发现什么有用的信息。

接下来有试着把所有的mysql进程全部杀掉重启了,然后又试着重启了一下mysql,在错误日志里面发现了这个信息。

/usr/local/mysql/bin/mysqld: Disk is full writing './mysql-bin.~rec~' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space)

^G/usr/local/mysql/bin/mysqld: Retry in 60 secs. Message reprinted in 600 secs

原来是磁盘满了,使用df查了一下,发现根目录/使用了100%.导致mysql无法写入日志文件和相关信息,删除一部分文件就可以了......

猜你喜欢

转载自blog.csdn.net/zpf_nevergiveup/article/details/80385339
今日推荐