Mysql故障排除:Starting MySQL. ERROR! Manager of pid-file quit without updating file
安裝完mysql后,啟動(dòng)MYSQL時(shí)發(fā)現(xiàn)報(bào)錯(cuò),提示如下:[root@web-server log]# /etc/rc.d/init.d/mysqld startStarting MySQL. ERROR! Manager of pid-file quit without updating file.
看下日志:[root@web-server log]# cat alert.log100811 10:22:57 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data100811 10:22:57 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file' instead./usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)100811 10:22:57 [ERROR] Aborting
100811 10:22:57 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
100811 10:22:57 mysqld_safe mysqld from pid file /usr/local/mysql/data/web-server.pid ended100811 10:26:38 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data100811 10:26:38 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file' instead./usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)100811 10:26:38 [ERROR] Aborting
100811 10:26:38 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete
100811 10:26:38 mysqld_safe mysqld from pid file /usr/local/mysql/data/web-server.pid ended;
在網(wǎng)上找了如下方法,但依舊無(wú)法解決:
有人說(shuō)將/etc/my.cnf里面的 skip federated注釋掉即可,但我的my.cnf里壓根就沒(méi)有這一項(xiàng),還有人說(shuō)/etc/my.cnf中沒(méi)有設(shè)置datadir=/data/mysql,但我看了這一項(xiàng)已經(jīng)有了。還有說(shuō)data/mysql-bin.index沒(méi)有刪除,data/mysql-bin.index是存放日志文件索引的文件,只刪除了日志文件而沒(méi)有對(duì)日志的索引文件做處理顯然是不行的。但刪除data/mysql-bin.index文件,再service mysqld start還是不行。
應(yīng)該如何解決呢?
今天終于搞定了
mysql編譯如下:
CHOST="x86_64-pc-linux-gnu"CFLAGS="-march=nocona -O3 -pipe"CXXFLAGS="${CFLAGS}"./configure "--prefix=/usr/local/mysql" "--localstatedir=/data/mysql/data" "--with-comment=Source" "--with-mysqld-user=mysql" "--without-debug" "--with-big-tables" "--with-charset=gbk" "--with-collation=gbk_chinese_ci" "--with-extra-charsets=all" "--with-pthread" "--enable-static" "--enable-thread-safe-client" "--with-client-ldflags=-all-static" "--with-mysqld-ldflags=-all-static" "--enable-assembler" "--with-plugins=all" "--without-ndb-debug
makemake installuseradd mysql -d /data/mysql -s/sbin/nologin/usr/local/mysql/bin/mysql_install_db--user=mysqlcd /usr/local/mysqlchown -R mysql:mysql . 這一步一定要搞清楚,不要照網(wǎng)上的亂抄,到時(shí)候啟動(dòng)mysql時(shí)會(huì)因?yàn)槟夸洐?quán)限問(wèn)題而導(dǎo)致出錯(cuò)!謹(jǐn)記。mkdir -p /data/mysql/datachown -R mysql /data/mysql/datacp share/mysql/my-huge.cnf /etc/my.cnfcp share/mysql/mysql.server/etc/rc.d/init.d/mysqldchmod 755 /etc/rc.d/init.d/mysqldchkconfig --add mysqld/etc/rc.d/init.d/mysqld start;;cd /usr/local/mysql/binfor i in *; do ln -s /usr/local/mysql/bin/$i/usr/bin/$i; done
這樣,問(wèn)題就解決了[root@web-server local]# service mysqld startStarting MySQL.
相關(guān)文章:
1. 傳甲骨文將增加對(duì)MySQL投資與微軟競(jìng)爭(zhēng)2. mysql數(shù)據(jù)庫(kù)中最常用的時(shí)間轉(zhuǎn)換函數(shù)的用法3. Mysql入門(mén)系列:MYSQL列類(lèi)型選擇與MYSQL查詢(xún)效率4. MySQL中 concat函數(shù)的使用5. MySQL基本調(diào)度策略淺析6. MySQL sql_mode的使用詳解7. Mysql入門(mén)系列:MYSQL表達(dá)式求值和MYSQL類(lèi)型轉(zhuǎn)換8. Windows下不能啟動(dòng)mysql服務(wù)--錯(cuò)誤總結(jié)9. Windows下在DOS用mysql命令行導(dǎo)入.sql文件10. Windwos下MySQL 64位壓縮包的安裝方法學(xué)習(xí)記錄
