MySQL学习6_ERROR! MySQL server PID file could not be found!解决方法

来源:互联网 发布:淘宝一元拍卖真的吗 编辑:程序博客网 时间:2024/05/29 14:09

第一种:

可能是硬盘满了,清理下垃圾文件。


/etc/init.d/mysql start无法启动MySQL错误信息如下:

ERROR! MySQL server PID file could not be found!

Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/AYXXXXXXXXXXX.pid).

完整日志信息如下:

140902 18:11:33 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:11:33 InnoDB: The InnoDB memory heap is disabled
140902 18:11:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:11:33 InnoDB: Compressed tables use zlib 1.2.3
140902 18:11:33 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:11:33 InnoDB: Completed initialization of buffer pool
140902 18:11:33 InnoDB: highest supported file format is Barracuda.
140902 18:11:33  InnoDB: Waiting for the background threads to start
140902 18:11:34 InnoDB: 5.5.37 started; log sequence number 18321078305
/usr/local/mysql/bin/mysqld: File './mysql-bin.000035' not found (Errcode: 2)
140902 18:11:34 [ERROR] Failed to open log (file './mysql-bin.000035', errno 2)
140902 18:11:34 [ERROR] Could not open log file
140902 18:11:34 [ERROR] Can't init tc log
140902 18:11:34 [ERROR] Aborting

140902 18:11:34  InnoDB: Starting shutdown...
140902 18:11:35  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:11:35 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:11:35 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:12:55 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:12:56 InnoDB: The InnoDB memory heap is disabled
140902 18:12:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:12:56 InnoDB: Compressed tables use zlib 1.2.3
140902 18:12:56 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:12:56 InnoDB: Completed initialization of buffer pool
140902 18:12:56 InnoDB: highest supported file format is Barracuda.
140902 18:12:57  InnoDB: Waiting for the background threads to start
140902 18:12:58 InnoDB: 5.5.37 started; log sequence number 18321078305
/usr/local/mysql/bin/mysqld: File './mysql-bin.000035' not found (Errcode: 2)
140902 18:12:58 [ERROR] Failed to open log (file './mysql-bin.000035', errno 2)
140902 18:12:58 [ERROR] Could not open log file
140902 18:12:58 [ERROR] Can't init tc log
140902 18:12:58 [ERROR] Aborting

140902 18:12:58  InnoDB: Starting shutdown...
140902 18:12:58  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:12:58 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:12:58 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:30:59 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:30:59 InnoDB: The InnoDB memory heap is disabled
140902 18:30:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:30:59 InnoDB: Compressed tables use zlib 1.2.3
140902 18:30:59 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:30:59 InnoDB: Completed initialization of buffer pool
140902 18:30:59 InnoDB: highest supported file format is Barracuda.
140902 18:31:00  InnoDB: Waiting for the background threads to start
140902 18:31:01 InnoDB: 5.5.37 started; log sequence number 18321078305
/usr/local/mysql/bin/mysqld: File './mysql-bin.000035' not found (Errcode: 2)
140902 18:31:01 [ERROR] Failed to open log (file './mysql-bin.000035', errno 2)
140902 18:31:01 [ERROR] Could not open log file
140902 18:31:01 [ERROR] Can't init tc log
140902 18:31:01 [ERROR] Aborting

140902 18:31:01  InnoDB: Starting shutdown...
140902 18:31:01  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:31:01 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:31:01 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:32:10 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:32:10 InnoDB: The InnoDB memory heap is disabled
140902 18:32:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:32:10 InnoDB: Compressed tables use zlib 1.2.3
140902 18:32:10 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:32:10 InnoDB: Completed initialization of buffer pool
140902 18:32:10 InnoDB: highest supported file format is Barracuda.
140902 18:32:10  InnoDB: Waiting for the background threads to start
140902 18:32:11 InnoDB: 5.5.37 started; log sequence number 18321078305
/usr/local/mysql/bin/mysqld: File './mysql-bin.000035' not found (Errcode: 2)
140902 18:32:11 [ERROR] Failed to open log (file './mysql-bin.000035', errno 2)
140902 18:32:11 [ERROR] Could not open log file
140902 18:32:11 [ERROR] Can't init tc log
140902 18:32:11 [ERROR] Aborting

140902 18:32:11  InnoDB: Starting shutdown...
140902 18:32:11  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:32:11 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:32:11 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:32:14 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:32:14 InnoDB: The InnoDB memory heap is disabled
140902 18:32:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:32:14 InnoDB: Compressed tables use zlib 1.2.3
140902 18:32:14 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:32:14 InnoDB: Completed initialization of buffer pool
140902 18:32:14 InnoDB: highest supported file format is Barracuda.
140902 18:32:14  InnoDB: Waiting for the background threads to start
140902 18:32:15 InnoDB: 5.5.37 started; log sequence number 18321078305
/usr/local/mysql/bin/mysqld: File './mysql-bin.000035' not found (Errcode: 2)
140902 18:32:15 [ERROR] Failed to open log (file './mysql-bin.000035', errno 2)
140902 18:32:15 [ERROR] Could not open log file
140902 18:32:15 [ERROR] Can't init tc log
140902 18:32:15 [ERROR] Aborting

140902 18:32:15  InnoDB: Starting shutdown...
140902 18:32:15  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:32:15 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:32:15 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:33:15 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:33:15 InnoDB: The InnoDB memory heap is disabled
140902 18:33:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:33:15 InnoDB: Compressed tables use zlib 1.2.3
140902 18:33:15 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:33:15 InnoDB: Completed initialization of buffer pool
140902 18:33:15 InnoDB: highest supported file format is Barracuda.
140902 18:33:15  InnoDB: Waiting for the background threads to start
140902 18:33:16 InnoDB: 5.5.37 started; log sequence number 18321078305
/usr/local/mysql/bin/mysqld: File './mysql-bin.000035' not found (Errcode: 2)
140902 18:33:16 [ERROR] Failed to open log (file './mysql-bin.000035', errno 2)
140902 18:33:16 [ERROR] Could not open log file
140902 18:33:16 [ERROR] Can't init tc log
140902 18:33:16 [ERROR] Aborting

140902 18:33:16  InnoDB: Starting shutdown...
140902 18:33:17  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:33:17 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:33:17 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:34:05 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:34:05 [Warning] You need to use --log-bin to make --binlog-format work.
140902 18:34:05 InnoDB: The InnoDB memory heap is disabled
140902 18:34:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:34:05 InnoDB: Compressed tables use zlib 1.2.3
140902 18:34:05 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:34:05 InnoDB: Completed initialization of buffer pool
140902 18:34:05 InnoDB: highest supported file format is Barracuda.
140902 18:34:05  InnoDB: Waiting for the background threads to start
140902 18:34:06 InnoDB: 5.5.37 started; log sequence number 18321078305
140902 18:34:06 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140902 18:34:06 [Note]  - '0.0.0.0' resolves to '0.0.0.0';
140902 18:34:06 [Note] Server socket created on IP: '0.0.0.0'.
140902 18:34:07 [Note] Event Scheduler: Loaded 0 events
140902 18:34:07 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.37'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
140902 18:34:30 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown

140902 18:34:30 [Note] Event Scheduler: Purging the queue. 0 events
140902 18:34:30  InnoDB: Starting shutdown...
140902 18:34:30  InnoDB: Shutdown completed; log sequence number 18321078305
140902 18:34:30 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140902 18:34:30 mysqld_safe mysqld from pid file /usr/local/mysql/var/AY140429171715Z.pid ended
140902 18:34:31 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
140902 18:34:31 [Warning] You need to use --log-bin to make --binlog-format work.
140902 18:34:31 InnoDB: The InnoDB memory heap is disabled
140902 18:34:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140902 18:34:31 InnoDB: Compressed tables use zlib 1.2.3
140902 18:34:31 InnoDB: Initializing buffer pool, size = 16.0M
140902 18:34:31 InnoDB: Completed initialization of buffer pool
140902 18:34:31 InnoDB: highest supported file format is Barracuda.
140902 18:34:31  InnoDB: Waiting for the background threads to start
140902 18:34:32 InnoDB: 5.5.37 started; log sequence number 18321078305
140902 18:34:32 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140902 18:34:32 [Note]  - '0.0.0.0' resolves to '0.0.0.0';
140902 18:34:32 [Note] Server socket created on IP: '0.0.0.0'.
140902 18:34:32 [Note] Event Scheduler: Loaded 0 events
140902 18:34:32 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.37'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

启动会报错Starting MySQL.. ERROR! The server quit without updating PID file (/var/local/mysql/var/AYxxxxxxx.pid)原因是因为 mysql-bin.0000*的文件占满系统盘,磁盘空间不足导致无法写入。

解决方法:

1:删除所有mysql-bin.0000*日志文件全部rm掉

2:修改在my.cnf 文件,找到 log-bin=mysql-bin 将其启注释掉,以后就不会产生2进制的mysql-bin.0000*的日志文件

原文来自:

http://www.linuxidc.com/Linux/2014-09/106094.htm


第二种:

进程卡死

[root@centos var]# service mysqld stop

MySQL manager or server PID file could not be found!       [FAILED]
解决办法:
首先查看一下进程
[root@irxpert-test /]# ps aux |grep mysq*
root     10274  0.0  0.0  68160  1336 ?        S    13:43   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/irxpert-test.pid
mysql    10353  0.0  1.0 344360 39464 ?        Sl   13:43   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/irxpert-test.err --pid-file=/var/lib/mysql/irxpert-test.pid
root     11884  0.0  0.0  63384   760 pts/1    S+   15:44   0:00 grep mysq*
如果看到上面的内容,那说明,Mysql的进程卡死了,这时用就要把这些卡死的进程都关闭
[root@centos mysql]# kill 10274
[root@centos mysql]# kill 10353
启动Mysqlok
[root@centos mysql]# service mysql start
Starting MySQL.                                            [  OK  ]


原文来自:

http://blog.sina.com.cn/s/blog_4f925fc30100rx5l.html

 

第三种:

是修改过my.cnf配置出错引起 执行命令:vi /etc/my.cnf  修改内容:

# The MySQL server
    [mysqld]
    port   = 3306
   socket  = /var/lib/mysql/mysql.sock

在执行第二种命令,OK


原文来自:

http://blog.csdn.net/wuzhilon88/article/details/17616635


0 0
原创粉丝点击