2012年12月24日 星期一

學校首頁當掉了

今日上午,上班後同仁告知學校首頁進不去了,出現資料庫錯誤的訊息!
查看mysql.log結果如下:

121224 11:05:47 [Note] /usr/libexec/mysqld: Normal shutdown

121224 11:05:48  InnoDB: Starting shutdown...
121224 11:05:51  InnoDB: Shutdown completed; log sequence number 0 43665
121224 11:05:51 [Note] /usr/libexec/mysqld: Shutdown complete

121224 11:05:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
121224 11:08:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
121224 11:08:13 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
121224 11:08:14  InnoDB: Started; log sequence number 0 43665
121224 11:08:14 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
121224 11:08:14 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50045, now running 50148. Please use mysql_upgrade to fix this error.
121224 11:08:14 [ERROR] mysql.user has no `Event_priv` column at position 29
121224 11:08:14 [ERROR] Cannot open mysql.event
121224 11:08:14 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
121224 11:08:14 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.48'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) by Remi

經GOOGLE查詢,發生的原因可能是Mysql升級後產生資料表不存在的錯誤訊息,解決的方法如下:

自己建立這張表。


use mysql;

CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM;

沒有留言:

張貼留言