Linux

數據庫選擇錯誤

  • May 9, 2016

數據庫選擇錯誤是我的問題,當我重新啟動 mysql 以修復此錯誤時,此問題已解決,但 30 分鐘或數小時後再次發生此錯誤。

我把連結放在這裡來自 ssh 的截圖

$$ putty $$錯誤我該怎麼辦?為什麼會這樣?

tail -f /var/log/mysqld.log
120813 17:33:57 InnoDB: Completed initialization of buffer pool
120813 17:33:57 InnoDB: highest supported file format is Barracuda.
120813 17:33:57  InnoDB: Waiting for the background threads to start
120813 17:33:58 InnoDB: 1.1.8 started; log sequence number 63473783633
120813 17:33:58 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50092, now running 50516. Please use mysql_upgrade to fix this error.
120813 17:33:58 [ERROR] mysql.user has no `Event_priv` column at position 29
120813 17:33:58 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
120813 17:33:58 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.16'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) by Remi
  1. 重新安裝你的 mysql 但不推薦使用mysql_upgrade
  2. 檢查 mysql db 中的使用者表,它似乎缺少列或行
  3. 修復損壞的數據庫使用mysqlcheck -rA -u root -p

執行 mysqlcheck,見這裡 – http://scottlinux.com/2012/06/09/use-mysqlcheck-to-optimize-and-repair-mysql-databases/

另外,檢查您的 RAM/磁碟是否沒有問題。此外,升級到您正在執行的任何版本的 MySQL 的最新版本。

引用自:https://serverfault.com/questions/416977