1. 程式人生 > >Starting MySQL. ERROR! The server quit without updating PID file......

Starting MySQL. ERROR! The server quit without updating PID file......

This step-by-step guide is mainly for FreeBSD, however the idea is the same for Linux. Every once a while, when I update my FreeBSD box, the system likes to shutdown my MySQL server. Therefore, I need to start it again after the update is done. Unfortunately, the upgrade process is not smooth every time. Sometimes it will throw me some error.

/usr/local/etc/rc.d/mysql.server start

Oh well, I got the following error messages:

Starting MySQL..... ERROR! The server quit without updating PID file.

Sometimes, the message will tell you the exact location of which PID file:

Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).

There are several solutions to troubleshoot these problems. I will go over each one by one.

Solution 1: Reboot The Computer

Although it sounds simple, but it really works. During the system upgrade, the OS may disable some of your daemons. Instead of troubleshooting each one by one, the easiest way is to start everything over. For example, I experienced this problem today after upgrading the Apache and Ruby

 (Yes, MySQL is not part of the update), and I got this error message afterward. After rebooting the computer, the error message is gone.

Solution 2: Remove Your MySQL Config File

If you have modified your MySQL configuration file, MySQL may not like it few versions after (MySQL is not backward compatibility friendly). It can be the problem of using an unsupported variable, or something similar. The easiest way is to remove your configuration file, and try to start the MySQL server again:

Backup your MySQL configuration first.  我是在這一步操作完成後,成功的(有可能自己指定的安裝路徑的原因)

mv /etc/my.cnf /etc/my.cnf.backup

And restart the MySQL server again:

/usr/local/share/mysql/mysql.server start

Hopefully you will see the following message:

Starting MySQL. SUCCESS!

Solution 3: Upgrade Your Database File

Sometimes, the newer MySQL doesn’t like the database created in earlier version. I discovered this when I upgrade to MySQL 5.5.7:

Starting MySQL..... ERROR! The server quit without updating PID file (/var/db/mysql/www.icesquare.com.pid).

Since MySQL tells me which PID file causes the problem, I open the file and take a look what’s going on:

sudo tail /var/db/mysql/www.icesquare.com.err

And I saw something interesting: tables: Table ‘mysql.proxies_priv’ doesn’t exist:

101112 10:49:16  InnoDB: Initializing buffer pool, size = 128.0M
101112 10:49:16  InnoDB: Completed initialization of buffer pool
101112 10:49:16  InnoDB: highest supported file format is Barracuda.
101112 10:49:17  InnoDB: 1.1.3 started; log sequence number 1589404
101112 10:49:17 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.proxies_priv' doesn't exist
101112 10:49:17 mysqld_safe mysqld from pid file /var/db/mysql/www.icesquare.com.pid ended

The reason is very simple. MySQL could not open a table created in the earlier version (< 5.7.7) because it is not compatible with the current version. So, we can try to start the MySQL in safe mode through rc.d. First, you can edit the /etc/rc.conf and put the following into the file:

mysql_enable="YES"
mysql_args="--skip-grant-tables --skip-networking"

Restart MySQL through rc.d:

/usr/local/etc/rc.d/mysql-server start

If you did it right, you should see something like the following:

Starting MySQL.. SUCCESS!

Now, MySQL is already running the safe-mode. We want to perform a MySQL upgrade on all tables:

sudo mysql_upgrade

You should see something like this:

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.servers                                      OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Running 'mysql_fix_privilege_tables'...
OK

Now, we want to switch the MySQL back to normal mode by commenting the extra options in /etc/rc.conf:

mysql_enable="YES"
#mysql_args="--skip-grant-tables --skip-networking"

And restart MySQL through /etc/rc.d:

/usr/local/etc/rc.d/mysql-server restart

Now the MySQL is up and running again!

Happy MySQLing.

–Derrick

相關推薦

mysql啟動時報錯:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid)

.com quit blog erro selinux 打開 archive out com mysql啟動報錯Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/da

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

剛接觸MySql資料庫,參考一些文章後搭建起來了也建立了資料庫,程式跑到很好,一覺醒來突然連線不上了 MySql資料庫了。 研究了好一會才找到原因。 現象: 登入資料庫失敗 [[email protected]_0_6_centos ~]# mysql -u root -p******War

Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/vm10-0-0-19

 輸入:service mysqld start  報錯:  Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/vm10-0-0-19

MySQL: Starting MySQL….. ERROR! The server quit without updating PID file解決辦法

1、問題: [[email protected] data]# /etc/init.d/mysql start Starting MySQL...The server quit without updating PID file (/db/mysql/data/i

MySql錯誤:Starting MySQL...ERROR!The server quit without updating PID file

mysql初始化成功之後,然後配置了些引數,然後啟動mysql服務,結果又報錯了 照樣開始百度,網上還是一堆麻煩的方法,檢視日誌,許可權是對的,因為我這裡使用的是mysql使用者和mysql使用者組。還有一個是把本地伺服器的***.pid檔案拷貝到/usr/local/mysql/data

Starting MySQL. ERROR! The server quit without updating PID file......

This step-by-step guide is mainly for FreeBSD, however the idea is the same for Linux. Every once a while, when I update my FreeBSD box, the system likes

啟動mysql出錯Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/spark01.pi

參考檔案的連結地址:http://icesquare.com/wordpress/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file/

在Centos上安裝MySQL時出現這樣的錯誤:Starting MySQL.. ERROR! The server quit without updating PID file (/usr/loca

MySQL的版本是:mysql-5.5.48-linux2.6-x86_64.tar.gzcentos6.6上安裝MySQL時出現的錯誤:[[email protected] mysql]# ./support-files/mysql.server startSta

Centos6 下 Mysql啟動提示 Starting MySQL. ERROR! The server quit without updating PID file

環境說明 Centos6.5  mysql  5.5.37 問題描述 檢視mysql服務,提示mysql沒有啟動,手動啟動後,提示如下: [[email protected] ~]#

mysql啟動報錯:Starting MySQL... ERROR! The server quit without updating PID file

mysql啟動時報錯:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid) 的解決方法:1、可能是/opt/mysql/data/資料目錄m

mysql啟動時報錯:Starting MySQL... ERROR! The server quit without updating PID file ?

報錯資訊如下:MySQL server PID file could not be found!                  [FAILED]Starting MySQL.../usr/local/mysql/bin/mysqld_safe: line 181:  24

fedora20 Starting MySQL. ERROR! The server quit without updating PID file /var/lib/mysql/Master.Hado

今天嘗試在fedora20下安裝了下mysql, 檢視/var/lib/mysql/Master.Hadoop.err日誌發現報瞭如下的錯於是找到這篇文章,才得以解決。 Table 'mysql.plugin' doesn't exist。 但是很不幸的是,安裝過程中出

mysql啟動時報錯:Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql/data/mysql.pid) 的解決方法

#tail -f /data/mysql/logs/error.log 160721 06:12:07 mysqld_safe Starting mysqld daemon with databases from /data/mysql/data 2016-07-21 06:12:10 0 [Warni

Starting MySQL... ERROR! The server quit without updating PID file 問題解決

其中 丟失 一行 也有 index erro 報錯 估計 不清楚 今天遇到一個mysql起不來,不知為啥掛了,啟動是下面的報錯 Starting MySQL... ERROR! The server quit without updating PID file 後來進到/u

啟動mysql報錯 -- ERROR! The server quit without updating PID file

bash cal down tar bsp 二進制 pda you log-bin 開發說某個測試環境的mysql,無法重啟了,報以下錯誤提示: # service mysqld restart Shutting down MySQL.. SUCCESS! Starti

報錯:ERROR! The server quit without updating PID file (/usr/local/var/mysql/chenyuntekiMacBook-Air.local.pid).

在Mac上通過brew install mysql 安裝了完mysql 執行mysql.server start 報錯:ERROR! The server quit without updating PID file (/usr/local/var/mysql/chenyuntekiMacBook-Air

mysql啟動報錯... ERROR! The server quit without updating PID file (/usr/local/mysql/data/test.pid

公司的伺服器突然斷電了,恢復後重啟mysql報錯如下 Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/data/test.pid)      &

mysql啟動之 ERROR! The server quit without updating PID file (/usr/local/mysql/data/gujingdeMacBook-Pro

啟動mysql時,出現如下錯誤: ERROR! The server quit without updating PID file (/usr/local/mysql/data/gujingdeMacBook-Pro.local.pid). 可能的解決方式:

Centos7啟動mysql5.6 提示ERROR! The server quit without updating PID file (/var/lib/mysql/XXX.pid).

Centos7安裝安裝MySQL-server-5.6.35-1.el7.x86_64.rpm,提示安裝失敗,因為Centos7安裝時預設安裝mariadb-libs.XXXXXX.rpm, 需要解除

MySQL提示:The server quit without updating PID file問題的解決辦法

刪除 沒有 關閉 file title 錯誤日誌 可能 service 重新啟動 轉 http://www.jb51.net/article/48625.htm 今天網站web頁面提交內容到數據庫,發現出錯了,一直提交不了,數找了下原因,發現數據寫不進去!第一反應,重啟my