第一種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:INSERT INTO `qb_article_db` (`aid`) VALUES ('68536')
Duplicate entry '68536' for key 'PRIMARY'
1062
解決辦法:
在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:DELETE FROM qb_article_db WHERE aid>68536
第二種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT A.*,R.* FROM qb_article A LEFT JOIN qb_reply R ON A.aid=R.aid WHERE A.aid=65 ORDER BY R.rid ASC LIMIT 0,1
Can't create/write to file 'C:\WINDOWS\TEMP\#sql_658_0.MYD' (Errcode: 17)
1
解決辦法:
在my.ini中[mysqld]里面添加一行
tmpdir="c:/mysql/temp/" 或?qū)?sql_658_0.MYD刪除后再重啟Mysql服務(wù)
第三種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT R.*,A.* FROM qb_article A LEFT JOIN qb_reply R ON A.aid=R.aid WHERE A.aid=608 ORDER BY R.topic DESC,R.orderid ASC LIMIT 0,1
Got error 28 from storage engine
1030
解決辦法:
清空在my.ini中tmpdir="c:/mysql/temp/"目錄下的文件,或者修改tmpdir參數(shù)指向具有足夠空間目錄。
第四種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT * FROM qb_article WHERE fid='2' ORDER BY list DESC LIMIT 8
Got error 127 from table handler
1030
解決辦法:
在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:REPAIR TABLE `qb_article `
第五種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT R.*,A.* FROM qb_article A LEFT JOIN qb_reply R ON A.aid=R.aid WHERE A.aid=687 ORDER BY R.topic DESC,R.orderid ASC LIMIT 0,1
Unknown column 'R.orderid' in 'order clause'
1054
解決辦法:在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:ALTER TABLE `qb_reply` ADD `orderid` MEDIUMINT( 8 ) NOT NULL ;
第六種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT * FROM p8_label WHERE lid='1'
Table 'zyp.p8_label' doesn't exist
1146
解決辦法:
在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:CREATE TABLE IF NOT EXISTS `p8_label` (
`lid` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`ch` smallint(4) NOT NULL DEFAULT '0',
`chtype` tinyint(2) NOT NULL DEFAULT '0',
`tag` varchar(50) NOT NULL DEFAULT '',
`type` varchar(30) NOT NULL DEFAULT '',
`typesystem` tinyint(1) NOT NULL DEFAULT '0',
`code` text NOT NULL,
`divcode` text,
`hide` tinyint(1) NOT NULL DEFAULT '0',
`js_time` int(10) NOT NULL DEFAULT '0',
`uid` mediumint(7) NOT NULL DEFAULT '0',
`username` varchar(30) NOT NULL DEFAULT '',
`posttime` int(10) NOT NULL DEFAULT '0',
`pagetype` tinyint(3) NOT NULL DEFAULT '0',
`module` mediumint(6) NOT NULL DEFAULT '0',
`fid` mediumint(7) NOT NULL DEFAULT '0',
`if_js` tinyint(1) NOT NULL DEFAULT '0',
`style` varchar(40) NOT NULL DEFAULT '',
PRIMARY KEY (`lid`),
KEY `ch` (`ch`,`pagetype`,`module`,`fid`,`chtype`),
KEY `tag` (`tag`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk AUTO_INCREMENT=1 ;
第七種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:insert into p8_group(usr,groupid,grouptitle,sex,ip,ipfrom,time,where_name,hide,where_id,where_fid,onl_id,sid,url,windows) values ('','','管理員','','10.0.0.39','Unknow','1143167041','','','','','','8FWKel5RHLEWStmRoesvu35BSYW6K1uH','http://10.0.0.39/02/index.php','|')
Incorrect integer value: '' for column 'groupid' at row 1
1366
解決辦法:
在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:ALTER TABLE `p8_group` CHANGE `groupid` `groupid` INT( 4 ) NOT NULL AUTO_INCREMENT
第八種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT M.username AS username,M.password AS password,M.salt,D.* FROM `dz`.cdb_uc_members M LEFT JOIN p8_memberdata D ON M.uid=D.uid WHERE M.username='燃燈'
SELECT command denied to user for table 'cdb_uc_members'
1142
解決辦法:
比如mysql用戶名是root:在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:REVOKE ALL PRIVILEGES ON * . * ;
GRANT ALL PRIVILEGES ON * . * GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
第九種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT * FROM p8_article WHERE fid='32' AND yz=1 ORDER BY list DESC LIMIT 8
Incorrect key file for table '.\sq_biyangwang\p8_article.MYI'; try to repair it
126
解決辦法:
在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:REPAIR TABLE `p8_article `
第十種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT COUNT(id) AS Guestbook FROM p8_guestbook
Can't find file: './kp122799/p8_guestbook.frm' (errno: 13)
1017
解決辦法:
或許是權(quán)限問題,如mysql用戶名是root:在數(shù)據(jù)庫運行這段SQL:
復(fù)制代碼代碼如下:REVOKE ALL PRIVILEGES ON * . * FROM ;
GRANT ALL PRIVILEGES ON * . * TO WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
或重新啟動mysql,再不行嘗試對其數(shù)據(jù)表進(jìn)行修復(fù)。
第十一種:
數(shù)據(jù)庫連接出錯:
復(fù)制代碼代碼如下:SELECT COUNT(uid) AS Member FROM p8_members </p> <p>Table './xianxinbing/p8_members' was created with a different version of MySQL and cannot be read
1033
解決辦法:
升級你的Mysql或者修復(fù)優(yōu)化全部相關(guān)的數(shù)據(jù)表。
更多信息請查看IT技術(shù)專欄