天天看點

安裝MySQL5.1.24

打開event viewer發現有一條mysql的錯誤

can’t open and lock privilege tables: table ‘mysql.servers’ doesn’t exist

我是windows2k3 r2系統

後來翻到兩條解決辦法:

第一種解決辦法是:進入mysql的bin目錄運作mysql -u root -p mysql

輸入密碼後運作

mysql> source ../share/mysql_fix_privilege_tables.sql

這種辦法應該是repair資料庫!他會檢查如果沒有那個表就建立一個,應該是mysql5.1.24的一個bug。

第二種解決辦法是:

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 default charset=utf8 comment=’mysql foreign servers table’;

這種辦法比較簡單了,直接建一個servers表出來就是了~

不管哪種辦法,都是讓系統可以檢測到servers這個表存在就是了

google、baidu的時候看到很多人還有can’t open and lock privilege tables: table ‘mysql.host’ doesn’t exist的錯誤

處理方法應該和mysql.servers表不存在一樣的吧,都是缺啥給它建個啥就行~

哦,推薦使用第一種方法,比較簡單。看他的代碼就知道是