mysql啟動時報如下錯誤:ERROR! The rver quit without updating PID file (/data/mysql/localhost_002.pid).
[root@localhost_002 mysql]# /etc/init.d/mysqld startStarting MySQL. ERROR! The rver quit without updating PID file (/data/mysql/localhost_002.pid).
查看錯誤日記時發現好多IonoDB的錯誤:
在百度上搜索到的結果及排查步驟如下:
1、可能是進程已經存在了mysql的進程:發現沒有這個進程:
解決方法:用ps aux |grep msyql 查看,并且用kill -9 殺死,然后重啟mysql;
[root@localhost_002 ~]# ps aux |grep mysqldroot 1176 0.0 0.0 112720 972 pts/0 S+ 22:07 0:00 grep --color=auto mysqld
2、可能是mysql的數據庫目錄所屬主和組不是mysql,或者是沒有執行權限;修改后還是不行;
[root@localhost_002 mysql]# chown -R mysql:mysql /data/mysql/[root@localhost_002 mysql]# chmod -R 755 /data/mysql/[root@localhost_002 mysql]# /etc/init.d/mysqld startStarting MySQL. ERROR! The rver quit without updating PID file (/data/mysql/localhost_002.pid).
3、可能是第二次在機器上安裝mysql,有殘余數據影響了服務的啟動;本機不存在這種類型的文件;
解決方法:去mysql的數據目錄/data/mysql/看看,如果存在mysql-bin.index,就趕快把它刪除掉;
4、mysql在啟動時沒有指定datadir:配置文件:/etc/my.cnf
[root@localhost_002 mysql]# vim /etc/my.cnfdatadir=/data/mysqlsocket=/tmp/mysql.sock[root@localhost_002 mysql]# rvice mysqld startStarting MySQL. ERROR! The rver quit without updating PID file (/data/mysql/localhost_002.pid).
5、skip-federated字段問題;還是不行:
解決方法:檢查一下/etc/my.cnf文件中有沒有沒被注釋掉的skip-federated字段,如果有就立即注釋掉;
6、linux的問題:關閉它;
[root@localhost_002 mysql]# getenforceDisabled[root@localhost_002 ~]# rvice mysqld startStarting MySQL. ERROR! The rver quit without updating PID file (/data/mysql/localhost_002.pid).
無果,再次查看日記如下:
2018-10-04 22:19:59 2510 [Note] InnoDB: Initializing buffer pool, size = 128.0M2018-10-04 22:19:59 2510 [Note] InnoDB: Completed initialization of buffer pool2018-10-04 22:19:59 2510 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new databa to be created!2018-10-04 22:19:59 2510 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB2018-10-04 22:19:59 2510 [Note] InnoDB: Databa physically writes the file full: wait...2018-10-04 22:19:59 2510 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB2018-10-04 22:20:00 2510 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB2018-10-04 22:20:02 2510 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile02018-10-04 22:20:02 2510 [Warning] InnoDB: New log files created, LSN=457812018-10-04 22:20:02 2510 [Note] InnoDB: Doublewrite buffer not found: creating new2018-10-04 22:20:02 2510 [Note] InnoDB: Doublewrite buffer created2018-10-04 22:20:02 2510 [Note] InnoDB: 128 rollback gment(s) are active.
看到有關./ib_logfie101的文件:進入到mysql的數據庫目錄下,刪除這些ib開頭文件(刪除前建議先備份下,不然數據會丟失);
[root@localhost_002 ~]# cd /data/mysql/[root@localhost_002 mysql]# ls aria_log_control ib_buffer_pool ib_logfile0 ib_logfile101 multi-master.info performance_schema aria_log.00000001 auto.cnf ibdata1 ib_logfile1 localhost_002.err mysql test[root@localhost_002 mysql]# rm -fr ib\_*[root@localhost_002 mysql]# rm -fr ibdata*[root@localhost_002 mysql]# /etc/init.d/mysqld startStarting MySQL.... SUCCESS!
此時發現可以正常啟動了:
查看下相關進程: ps aux |grep msyqld
[root@localhost_002 mysql]# ps aux |grep mysqldroot 2359 0.0 0.1 113308 1632 pts/0 S 22:19 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/localhost_002.pidmysql 2510 0.0 46.2 1305940 462072 pts/0 Sl 22:19 0:01 /usr/local/mysql/bin/mysqld --badir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --ur=mysql --log-error=localhost_002.err --pid-file=/data/mysql/localhost_002.pid --socket=/tmp/mysql.sockroot 2558 0.0 0.0 112720 972 pts/0 S+ 22:49 0:00 grep --color=auto mysqld
本文發布于:2023-02-28 20:08:00,感謝您對本站的認可!
本文鏈接:http://www.newhan.cn/zhishi/a/167765730579532.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:found.002(found.002拒絕訪問).doc
本文 PDF 下載地址:found.002(found.002拒絕訪問).pdf
| 留言與評論(共有 0 條評論) |