MySQL報錯:ERROR 2013 (HY000): Lost connection to MySQL server during query

    首先貼上實驗用各版本:

OS:CentOS 6.5

MySQL:

mysql> select version ();
+------------+
| version () |
+------------+
| 5.6.22     |
+------------+
1 row in set (0.00 sec)

事情是這樣的:本來是要在虛機上搭建一個wordpress做實驗,剛創建完數據庫,就在賦權額時候發生不在計劃的錯誤:

mysql>grant all on wordpress.* to wordpress@localhost identified by "wp123456";

ERROR 2013 (HY000): Lost connection to MySQL server during query

查看報錯日誌如下:tail -fn 30 /var/log/mysqld.log

2016-11-15 12:56:22 112085 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it

2016-11-15 12:56:22 112085 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure

2016-11-15 12:56:22 112085 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure

2016-11-15 12:56:22 112085 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure

2016-11-15 12:56:22 112085 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure

    看報錯日誌一直在提示wrong structure(結構錯誤),通常結構錯誤是由升級MySQL版本導致的,我雖然沒有升級,但是在安裝MySQL5.6.22前,安裝的是5.1版本,可能是由於卸除的不乾淨(但是之前在賦權時並沒有此問題,疑惑??),看了網上N多方法,但是對於我的問題就是不感冒啊!突然在網上看到一個升級腳本修復的例子,就想着我的是不是也適用(因爲我之前裝過舊版本),所以就試了一下果然OK啊!看到成功那一刻,一掃額頭陰霾O(∩_∩)O~

    執行升級腳本命令:

/usr/local/mysql/bin/mysql_upgrade -u root -p

輸入密碼後回車,再次賦權成功啦,哇咔咔..........

wKioL1gqxgKhfSrTAADe8f3cVx0562.png-wh_50

mysql> grant all on wordpress.* to wordpress@localhost identified by "wp123456";
Query OK, 0 rows affected (0.00 sec)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章