涓�銆丆an't connect to MySQL server on 'localhost' (10061)
缈昏瘧锛氫笉鑳借繛鎺ュ埌 localhost 涓婄殑mysql
鍒嗘瀽锛氳繖璇存槑鈥渓ocalhost鈥濊绠楁満鏄瓨鍦ㄧ殑锛屼絾鍦ㄨ繖鍙版満鍣ㄤ笂鍗存病鎻愪緵MySQL鏈嶅姟銆�
闇�瑕佸惎鍔ㄨ繖鍙版満鍣ㄤ笂鐨凪ySQL鏈嶅姟,濡傛灉鏈哄瓙璐熻浇澶珮娌$┖鐩稿簲璇锋眰涔熶細浜х敓杩欎釜閿欒銆�
瑙e喅:鏃㈢劧娌℃湁鍚姩閭e氨鍘诲惎鍔ㄨ繖鍙版満瀛愮殑mysql銆傚鏋滃惎鍔ㄤ笉鎴愬姛锛屽鏁版槸鍥犱负浣犵殑my.ini閰嶇疆鐨勬湁闂銆傞噸鏂伴厤缃叾鍗冲彲銆�
濡傛灉瑙夊緱mysql璐熻浇寮傚父锛屽彲浠ュ埌mysql/bin 鐨勭洰褰曚笅鎵цmysqladmin -uroot -p123 processlist鏉ユ煡鐪媘ysql褰撳墠鐨勮繘绋嬨��
浜屻�乁nknown MySQL Server Host 'localhosadst' (11001)
缈昏瘧锛氭湭鐭ョ殑MySQL鏈嶅姟鍣� localhosadst
鍒嗘瀽锛氭湇鍔″櫒 localhosasdst 涓嶅瓨鍦ㄣ�傛垨鑰呮牴鏈棤娉曡繛鎺�
瑙e喅锛氫粩缁嗘鏌ヨ嚜宸辫鍧涗笅闈㈢殑 ./config.inc.php鎵惧埌$dbhost閲嶆柊璁剧疆涓烘纭殑mysql 鏈嶅姟鍣ㄥ湴鍧�銆�
涓夈�丄ccess denied for user: 'roota@localhost' (Using password: YES)
缈昏瘧锛氱敤鎴� roota 璁块棶 localhost 琚嫆缁濓紙娌℃湁鍏佽閫氳繃锛�
鍒嗘瀽锛氶�犳垚杩欎釜閿欒涓�鑸暟鎹簱鐢ㄦ埛鍚嶅拰瀵嗙爜鐩稿mysql鏈嶅姟鍣ㄤ笉姝g‘
瑙e喅锛氫粩缁嗘鏌ヨ嚜宸辫鍧涗笅闈㈢殑 ./config.inc.php 鎵惧埌$dbuser銆�$dbpw鏍稿疄鍚庨噸鏂拌缃繚瀛樺嵆鍙��
鍥涖�丄ccess denied for user: 'red@localhost' to database 'newbbs'
缈昏瘧锛氱敤鎴� red 鍦╨ocalhost 鏈嶅姟鍣ㄤ笂娌℃湁鏉冮檺鎿嶄綔鏁版嵁搴搉ewbbs
鍒嗘瀽锛氳繖涓彁绀哄拰闂涓夋槸涓嶅悓鐨勩�傞偅涓槸鍦ㄨ繛鎺ユ暟鎹簱鐨勬椂鍊欏氨琚樆姝簡锛岃�岃繖涓敊璇槸鍦ㄥ鏁版嵁搴撹繘琛屾搷浣滄椂寮曡捣鐨勩�傛瘮濡傚湪select update绛夌瓑銆傝繖涓槸鍥犱负璇ョ敤鎴锋病鏈夋搷浣滄暟鎹簱鐩稿簲鐨勬潈鍔涖�傛瘮濡俿elect 杩欎釜鎿嶄綔鍦╩ysql.user.Select_priv閲岃褰� Y 鍙互鎿嶄綔N 涓嶅彲浠ユ搷浣溿��
瑙e喅锛氬鏋滄槸鑷繁鐨勭嫭绔嬩富鏈洪偅涔堟洿鏂癿ysql.user 鐨勭浉搴旂敤鎴疯褰曪紝姣斿杩欓噷瑕佹洿鏂扮殑鐢ㄦ埛涓簉ed 銆傛垨鑰呯洿鎺ヤ慨鏀� ./config.inc.php 涓哄叾閰嶇疆涓�涓叿鏈夊鏁版嵁搴撴搷浣滄潈闄愮殑鐢ㄦ埛
鎴栬�呴�氳繃濡備笅鐨勫懡浠ゆ潵鏇存柊鎺堟潈grant all privileges on dbname.* to 'user'@'localhost' identified by 'password鈥�
鎻愮ず锛氭洿鏂颁簡mysql搴撲腑鐨勮褰曚竴瀹氳閲嶅惎mysql鏈嶅姟鍣ㄦ墠鑳戒娇鏇存柊鐢熸晥
FLUSH PRIVILEGES;
浜斻�丯o Database Selected
缈昏瘧锛氭病鏈夋暟鎹簱琚�夋嫨涓�
鍒嗘瀽锛氫骇鐢熺殑鍘熷洜鏈変袱绉�
config.inc.php 閲岄潰$dbname璁剧疆鐨勪笉瀵广�傝嚧浣挎暟鎹簱鏍规湰涓嶅瓨鍦紝鎵�浠ュ湪 $db->select_db($dbname); 鏃惰繑鍥炰簡false
鍜屼笂闈㈤棶棰樺洓鏄竴鏍风殑锛屾暟鎹簱鐢ㄦ埛娌℃湁select鏉冮檺锛屽悓鏍蜂細瀵艰嚧杩欐牱鐨勯敊璇�傚綋浣犲彂鐜癱onfig.inc.php鐨勮缃病鏈変换浣曢棶棰橈紝浣嗚繕鏄彁绀鸿繖涓敊璇紝閭d竴瀹氬氨鏄繖绉嶆儏鍐典簡銆�
瑙e喅锛氬鐥囦笅鑽�
鎵撳紑config.inc.php 鎵惧埌$dbname鏍稿疄閲嶆柊閰嶇疆骞朵繚瀛�
鍚岄棶棰樺洓鐨勮В鍐虫柟娉�
鍏�丆an't open file: 'xxx_forums.MYI'. (errno: 145)
缈昏瘧锛氫笉鑳芥墦寮�xxx_forums.MYI
闂鍒嗘瀽锛�
杩欑鎯呭喌鏄笉鑳芥墦寮� cdb_forums.MYI 閫犳垚鐨勶紝寮曡捣杩欑鎯呭喌鍙兘鐨勫師鍥犳湁锛�
1銆佹湇鍔″櫒闈炴甯稿叧鏈猴紝鏁版嵁搴撴墍鍦ㄧ┖闂村凡婊★紝鎴栦竴浜涘叾瀹冩湭鐭ョ殑鍘熷洜锛屽鏁版嵁搴撹〃閫犳垚浜嗘崯鍧忋��
2銆佺被 unix 鎿嶄綔绯荤粺涓嬬洿鎺ュ皢鏁版嵁搴撴枃浠舵嫹璐濈Щ鍔ㄤ細鍥犱负鏂囦欢鐨勫睘缁勯棶棰樿�屼骇鐢熻繖涓敊璇��
瑙e喅鏂规硶锛�
1銆佷慨澶嶆暟鎹〃
鍙互浣跨敤涓嬮潰鐨勪袱绉嶆柟寮忎慨澶嶆暟鎹〃锛氾紙绗竴绉嶆柟娉曚粎閫傚悎鐙珛涓绘満鐢ㄦ埛锛�
1锛変娇鐢� myisamchk 锛孧ySQL 鑷甫浜嗕笓闂ㄧ敤鎴锋暟鎹〃妫�鏌ュ拰淇鐨勫伐鍏� 鈥斺�� myisamchk 銆傛洿鏀瑰綋鍓嶇洰褰曞埌 MySQL/bin 涓嬮潰锛屼竴鑸儏鍐典笅鍙湁鍦ㄨ繖涓笅闈㈡墠鑳借繍琛� myisamchk 鍛戒护銆傚父鐢ㄧ殑淇鍛戒护涓猴細myisamchk -r 鏁版嵁鏂囦欢鐩綍/鏁版嵁琛ㄥ悕.MYI锛�
2锛夐�氳繃 phpMyAdmin 淇锛� phpMyAdmin 甯︽湁淇鏁版嵁琛ㄧ殑鍔熻兘锛岃繘鍏ュ埌鏌愪竴涓〃涓悗锛岀偣鍑烩�滄搷浣溾�濓紝鍦ㄤ笅鏂圭殑鈥滆〃缁存姢鈥濅腑鐐瑰嚮鈥滀慨澶嶈〃鈥濆嵆鍙��
娉ㄦ剰锛氫互涓婁袱绉嶄慨澶嶆柟寮忓湪鎵ц鍓嶄竴瀹氳澶囦唤鏁版嵁搴撱��
2銆佷慨鏀规枃浠剁殑灞炵粍锛堜粎閫傚悎鐙珛涓绘満鐢ㄦ埛锛�
1锛夊鍒舵暟鎹簱鏂囦欢鐨勮繃绋嬩腑娌℃湁灏嗘暟鎹簱鏂囦欢璁剧疆涓� MySQL 杩愯鐨勫笎鍙峰彲璇诲啓锛堜竴鑸�傜敤浜�Linux鍜� FreeBSD 鐢ㄦ埛锛夈��
涓冦�乀able 'test.xxx_sessions' doesn't exist
缈昏瘧锛歺xxxx琛ㄤ笉瀛樺湪
鍒嗘瀽锛氬湪鎵цsql璇彞鏃舵病鏈夋壘鍒拌〃锛屾瘮濡傦細SELECT * FROM xxx_members WHERE uid=鈥橷X鈥� 杩欓噷濡傛灉琛▁xx_members涓嶅瓨鍦ㄤ簬$dbname搴撻噷锛岄偅涔堝氨浼氭彁绀鸿繖涓敊璇�傚叿浣撳彲鍒嗕负浠ヤ笅涓夌鎯呭喌鏉ヨ璁猴細
瀹夎鎻掍欢鎴栬�卙ack鏃朵慨鏀逛簡绋嬪簭鏂囦欢锛岃�屽繕璁颁簡瀵规暟鎹簱浣滅浉搴旂殑鍗囩骇銆�
鍚庡彴浣跨敤浜嗕笉瀹屽叏澶囦唤锛屽鍏ユ暟鎹椂娌℃湁瀵煎叆鍒板凡缁忓畨瑁呬簡鐩稿簲鐗堟湰鐨勮鍧涚殑鏁版嵁搴撲腑銆�
瑙e喅锛� 鍚屾牱瀵圭棁涓嬭嵂锛屼笉鍚岀殑鍘熷洜涓嶅悓鐨勫鐞嗘柟娉曘��
浠旂粏瀵圭収鎻掍欢浣滆�呮彁渚涚殑瀹夎璇存槑锛屾妸閬楁紡鐨勫鏁版嵁搴撶殑鎿嶄綔琛ヤ笂锛屽鏋滀粛鐒朵笉鑳借В鍐抽棶棰橈紝閭d箞搴旇鎬�鐤戣鎻掍欢鐨勫彲鐢ㄦ�т簡銆傚幓鍜ㄨ涓�涓嬫彃浠朵綔鑰咃紝鎴栬�呭皢鍏跺嵏杞姐��
涓嶈寮犲啝鏉庢埓锛屽澶х殑鑴氬氨绌垮澶х殑闉嬨�傛�讳箣浣垮緱绋嬪簭鏂囦欢鍜屾暟鎹簱閰嶅鍗冲彲.
鍏�乁nknown column 'column_name' in 'field list'
缈昏瘧锛氭湭鐭ョ殑瀛楁鍚� column_name
鍒嗘瀽锛氬湪鎵цsql璇彞鏄嚭鐜颁簡鎸囧畾琛ㄤ腑娌℃湁鐨勫瓧娈靛悕绉帮紝灏变細鍑虹幇杩欎釜閿欒銆傚叿浣撳鑷寸殑鍘熷洜鍙垎涓轰互涓嬩袱绉�
瀹夎鎻掍欢鎴栬�卙ack鏃朵慨鏀逛簡绋嬪簭鏂囦欢锛岃�屽繕璁颁簡瀵规暟鎹簱浣滅浉搴旂殑鍗囩骇銆�
绋嬪簭鏂囦欢鍜屾暟鎹簱涓嶉厤濂楋紝姣斿d2.5鐨勬暟鎹簱閰嶇疆缁檇4.1鐨勭▼搴忔潵鐢ㄨ偗瀹氫細鍑虹幇杩欎釜閿欒銆�
瑙e喅锛� 瀵艰嚧鐨勫師鍥犲拰闂鍏殑1鍜� 3鏄浉鍚岀殑锛屾墍浠ヨВ鍐虫柟娉曚篃涓�鏍枫��
涔濄�乊ou have an error in your SQL syntax
缈昏瘧锛氭湁涓�涓娉曢敊璇湪浣犵殑sql涓�
鍒嗘瀽锛氳鍧涙爣鍑嗙殑绋嬪簭鏄病鏈塻ql璇硶閿欒鐨勩�傛墍浠ラ�犳垚杩欎釜閿欒鐨勫師鍥犱竴鑸氨涓ょ被
瀹夎鎻掍欢鎴栨搮鑷慨鏀圭▼搴忋��
涓嶅悓鐨勬暟鎹簱鐗堟湰鏁版嵁搴撳鍑哄鍏ワ紝姣斿MySQL4.1鐨勬暟鎹湪瀵煎嚭鐨勮鍙ュ寘鍚簡MySQL4.0娌℃湁鐨勫姛鑳斤紝鍍忓瓧绗﹂泦鐨勮瀹氾紝杩欐椂濡傛灉灏嗚繖浜泂ql瀵煎叆鍒癕ySQL4.0鐨勬椂鍊欏氨浼氫骇鐢焥ql璇硶閿欒銆�
瑙e喅锛�
浠旂粏妫�鏌ョ湅鍒板簳鏄摢閲岀殑閿欒锛屽皢鍏朵慨姝o紝瀹炲湪涓嶈灏辩敤鏍囧噯绋嬪簭鎶婂嚭閿欑殑绋嬪簭鏇挎崲銆�
鍦ㄦ暟鎹簱澶囦唤鐨勬椂鍊欒鐣欐剰锛屽鏋滀笉鎵撶畻鍊掑叆鍒板叾浠栫増鏈殑mysql涓垯涓嶇敤鐗规畩鑰冭檻锛屽弽涔嬭鐗规畩鐨勮瀹氥�備娇鐢―Z4.1鐨勫悗鍙版暟鎹浠斤紝鍙互鎸夌収鎻愮ず鍘昏瀹氭兂瑕佺殑鏍煎紡銆傜嫭绔嬩富鏈虹殑涔熷彲浠ュ湪鍒板鐨勬椂鍊欏皢鍏跺鍑轰负mysql4.0鐨勬牸寮忋��
mysqldump -uroot -p --default-character-set=latin1 --set-charset=gbk --skip-opt databse > test.sql
鍗併�丏uplicate entry 'xxx' for key 1
缈昏瘧锛氭彃鍏� xxx 浣跨储寮�1閲嶅
鍒嗘瀽锛氱储寮曞鏋滄槸primary unique杩欎袱涓ょ锛岄偅涔堟暟鎹〃鐨勬暟鎹搴旂殑杩欎釜瀛楁灏卞繀椤讳繚璇佸叾姣忔潯璁板綍鐨勫敮涓�鎬с�傚惁鍒欏氨浼氫骇鐢熻繖涓敊璇��
涓�鑸彂鐢熷湪瀵规暟鎹簱鍐欐搷浣滅殑鏃跺�欙紝渚嬪Discuz!4.1璁哄潧绋嬪簭瑕佹眰鎵�鏈変細鍛樼殑鐢ㄦ埛鍚島sername蹇呴』鍞竴锛屽嵆username鐨勭储寮曟槸 unique锛岃繖鏃跺鏋滃己琛屽線cdb_members琛ㄩ噷鎻掑叆涓�涓凡鏈夌殑username鐨勮褰曞氨浼氬彂涓婅繖涓敊璇紝鎴栬�呭皢涓�鏉¤褰曠殑username鏇存柊 涓哄凡鏈夌殑涓�涓猽sername銆�
鏀瑰彉琛ㄧ粨鏋勭殑鏃跺�欎篃鏈夊彲鑳藉鑷磋繖涓敊璇�備緥濡� Discuz!4.0璁哄潧鐨勬暟鎹簱涓璫db_members.username 鐨勭储寮曠被鍨嬫槸index杩欎釜鏃跺�欐槸鍏佽鏈夌浉鍚寀sername鐨勮褰曞瓨鍦ㄧ殑锛屽湪鍗囩骇鍒�4.1鐨勬椂鍊欙紝鍥犱负瑕佸皢username鐨勭储寮曠敱鍘熸潵鐨刬ndex鍙� 涓簎nique銆傚鏋滆繖鏃禼db_members閲屽瓨鍦ㄦ湁鐩稿悓鐨剈sername鐨勮褰曪紝閭d箞灏变細寮曞彂杩欎釜閿欒銆�
瀵煎嚭鏁版嵁鎹椂鏈夋椂浼氬洜涓轰竴浜涘師鍥狅紙浣滆�呯洰鍓嶈繕涓嶆竻妤氾級瀵艰嚧鍚屼竴鏉¤褰曡閲嶅瀵煎嚭锛岄偅涔堣繖涓浠芥暟鎹湪瀵煎叆鐨勬椂鍊欏嚭鐜拌繖涓敊璇槸鍦ㄦ墍闅惧厤鐨勪簡銆�
淇敼浜哸uto_increment鐨勫�硷紝鑷翠娇鈥滀笅涓�涓� Autoindex鈥濅负涓�鏉″凡缁忓瓨鍦ㄧ殑璁板綍
瑙e喅锛� 涓ょ鎬濊矾锛屼竴鏄牬鍧忔帀鍞竴鎬х殑绱㈠紩銆備簩鏄妸閲嶅鐨勬暟鎹褰曞共鎺夛紝鍙繚鐣欎竴鏉°�傚緢鏄剧劧绗竴绉嶆�濊矾鏄笉鍙彇鐨勩�傞偅涔堟寜鐓т簩鐨勬�濊矾鎴戜滑寰楀嚭浠ヤ笅鍑犵瑙e喅鏂规硶锛屽搴斾笂闈㈢殑i ii iii
鐣�
鎸夌収閿欒鎻愮ず閲岀殑淇℃伅鍒版暟鎹簱涓皢閲嶅鐨勮褰曞垹闄わ紝浠呬繚鐣欎竴鏉″嵆鍙�備箣鍚庣户缁墽琛屽崌绾ф搷浣溿��
杩欑鎯呭喌鍙戠敓鐨勬鐜囧緢灏忥紝鍙互鐢ㄦ枃鏈紪杈戝櫒鎵撳紑澶囦唤鏂囨。锛屾煡鎵鹃噸澶嶇殑淇℃伅銆傚皢鍏跺浣欑殑鎷挎帀锛屼粎淇濈暀涓�鏉″嵆鍙��
鏌ヨ鍑鸿〃涓璦uto_increment鏈�澶х殑涓�鏉¤褰曪紝璁剧疆auto_incerment姣斿叾澶т竴鍗冲彲銆�
PS锛歳epaire table "琛ㄥ悕鈥滐紝鍙互鏆傛椂瑙e喅闂銆�
鍗佷竴銆� Duplicate key name 'xxx'
缈昏瘧锛氱储寮曞悕閲嶅
鍒嗘瀽锛氳鍒涘缓鐨勭储寮曞凡缁忓瓨鍦ㄤ簡锛屽氨浼氬紩鍙戣繖涓敊璇紝杩欎釜閿欒澶氬彂鐢熷湪鍗囩骇鐨勬椂鍊欍�傚彲鑳芥槸宸茬粡鍗囩骇杩囩殑锛岄噸澶嶅崌绾у紩璧风殑閿欒銆備篃鏈夊彲鑳芥槸涔嬪墠鐢ㄦ埛鎿呰嚜鍔犵殑绱㈠紩锛屽垰濂戒笌鍗囩骇鏂囦欢涓殑鎵�浠ョ浉鍚屼簡銆�
瑙e喅锛� 鐪嬬湅宸茬粡瀛樺湪鐨勭储寮曞拰瑕佹坊鍔犵殑绱㈠紩鏄惁涓�鏍凤紝涓�鏍风殑璇濆彲浠ヨ烦杩囪繖鏉ql璇彞锛屽鏋滀笉涓�鏍烽偅涔堢幇鍒犻櫎宸插瓨鍦ㄧ殑鎵�浠ワ紝涔嬪悗鍐嶆墽琛屻��
鍗佷簩銆� Duplicate column name 'xxx'
缈昏瘧锛氬瓧娈靛悕xxx閲嶅
鍒嗘瀽锛氭坊鍔犵殑瀛楁xxx宸茬粡瀛樺湪锛屽鍙戠敓鍦ㄥ崌绾ц繃绋嬩腑锛屼笌闂鍗佷簩鐨勪骇鐢熸槸涓�鏍风殑銆�
瑙e喅锛� 鐪嬩竴涓嬪凡缁忓瓨鍦ㄧ殑瀛楁鏄惁鍜屽皢瑕佹坊鍔犵殑瀛楁灞炴�у畬鍏ㄧ浉鍚岋紝濡傛灉鐩稿悓鍒欏彲浠ヨ烦杩囦笉鎵ц杩欏彞sql锛屽鏋滀笉涓�鏍峰垯鍒犻櫎鎺夎繖涓瓧娈点�備箣鍚庣户缁墽琛屽崌绾х▼搴忋��
鍗佷笁銆� Table 'xxx' already exists
缈昏瘧锛氭暟鎹〃xxx宸茬粡瀛樺湪
鍒嗘瀽锛歺xx琛ㄥ凡缁忓瓨鍦ㄤ簬搴撲腑锛屽啀娆¤瘯鍥惧垱寤鸿繖涓悕瀛楃殑琛ㄥ氨浼氬紩鍙戣繖涓敊璇�傚悓鏍峰鍙戠敓鍦ㄨ鍧涚殑鍗囩骇涓�傜被浼间簬闂鍗佷簩銆�
瑙e喅锛� 鐪嬬湅宸茬粡瀛樺湪鐨勮〃鏄惁鍜屽皢瑕佸垱寤虹殑琛ㄥ畬鍏ㄤ竴鏍凤紝涓�鏍风殑璇濆彲浠ヨ烦杩囦笉鎵ц杩欎釜sql锛屽惁鍒欒灏嗗瓨鍦ㄧ殑琛ㄥ厛鍒犻櫎锛屼箣鍚庣户缁墽琛屽崌绾ф枃浠躲��
鍗佸洓銆� Can't create database 'xxx'. Database exists
缈昏瘧锛氫笉鑳藉垱寤烘暟鎹簱xxx锛屾暟鎹簱宸茬粡瀛樺湪
鍒嗘瀽锛氫竴涓猰ysql涓嬮潰鐨勬暟鎹簱鍚嶇О蹇呴』淇濊瘉鍞竴鎬э紝鍚﹀垯灏变細鏈夎繖涓敊璇��
瑙e喅锛氭妸宸茬粡瀛樺湪鐨勬暟鎹簱鏀瑰悕鎴栬�呮妸灏嗚鍒涘缓鐨勬暟鎹簱鏀瑰悕锛屾�讳箣涓嶈浠栦滑鐨勫悕绉板啿绐併��
鍗佷簲銆� 灏忕粨锛堥拡瀵归棶棰� 11\12\13\14\15锛�
姝ょ被闂閿欒鎻愮ず涓兘鏆楄棌涓�涓叧閿瘝duplicate锛堥噸澶嶏級
閭d箞瀵逛簬mysql鏁版嵁搴撴潵璇翠粈涔堜笢瑗挎槸涓嶈兘閲嶅鐨勫憿锛�
鏁版嵁搴� database
鍚屼竴涓暟鎹簱涓嬫暟鎹〃 table
鍚屼竴涓暟鎹〃涓嬪瓧娈� column
鍚屼竴涓暟鎹〃涓嬬储寮� key
鍚屼竴涓暟鎹〃鍦ㄧ储寮曞敮涓�锛圲NIQUE PRIMARY锛夌殑鎯呭喌涓嬭褰曚腑鐨勮繖浜涘瓧娈典笉鍙互閲嶅
鍗佸叚銆乁nknown system variable 'NAMES'
缈昏瘧锛氭湭鐭ョ殑绯荤粺鍙橀噺NAMES
鍒嗘瀽锛歁ysql鐗堟湰涓嶆敮鎸佸瓧绗﹂泦璁惧畾锛屾鏃跺己琛岃瀹氬瓧绗﹂泦灏变細鍑虹幇杩欎釜閿欒銆�
瑙e喅锛� 灏唖ql璇彞涓殑SET NAMES 鈥榵xx鈥� 璇彞鍘绘帀
鍗佷竷銆� Lost connection to MySQL server during query
缈昏瘧锛歁ySQL鏈嶅姟鍣ㄥけ鍘昏繛鎺ュ湪鏌ヨ鏈熼棿
鍒嗘瀽锛氳繙绋嬭繛鎺ユ暟鎹簱鏄湁鏃朵細鏈夎繖涓棶棰樸�侻ySQL鏈嶅姟鍣ㄥ湪鎵ц涓�鏉ql璇彞鐨勬椂鍊欏け鍘讳簡杩炴帴閫犳垚鐨勩��
瑙e喅锛� 涓�鑸笉闇�瑕佹�庝箞鍘诲鐞嗭紝濡傛灉棰戠箒鐨勫嚭鐜伴偅涔堣�冭檻鏀瑰杽纭欢鐜銆�
鍗佸叓銆乁ser 'red' has exceeded the 'max_updates' resource (current value: 500)
缈昏瘧锛歮sql鐢ㄦ埛red宸茬粡瓒呰繃浜�'max_updates'锛堟渶澶ф洿鏂版鏁帮級锛�'max_questions'锛堟渶澶ф煡璇㈡鏁帮級锛�'max_connections'锛堟渶澶ц繛鎺ユ暟锛夛紝褰撳墠璁惧畾涓�500
鍒嗘瀽锛氬湪mysql鏁版嵁搴撶殑涓嬫湁涓�涓簱涓簃ysql锛屽畠鍏朵腑鏈変竴涓〃涓簎ser杩欓噷闈㈢殑绾綍姣忎竴鏉¢兘瀵瑰簲涓轰竴涓猰ysql鐢ㄦ埛鐨勬巿鏉冦�傚叾涓瓧娈� max_questions max_updates max_connections鍒嗗埆璁板綍鐫�鏈�澶ф煡璇㈡鏁� 鏈�澶ф洿鏂版暟 鏈�澶ц繛鎺ユ暟锛屽綋鐩墠鐨勪换浣曚竴涓弬鏁板ぇ浜庝换浣曚竴涓瀹氱殑鍊煎氨浼氫骇鐢熻繖涓敊璇��
瑙e喅锛� 鐙珛涓绘満鐢ㄦ埛鍙互鐩存帴淇敼鎺堟潈琛ㄣ�備慨鏀瑰畬涔嬪悗閲嶅惎mysql鎴栬�呰窡鏂版巿鏉冭〃锛岃繘鍏ysql鎻愮ず绗︿笅鎵ц
FLUSH PRIVILEGES;
璁板緱鍚庨潰瑕佹湁鍒嗗彿鈥�;鈥�
铏氭嫙涓绘満鐨勭敤鎴峰鏋滄�绘槸鍑虹幇杩欎釜闂鍙壘绌洪棿鍟嗗崗鍟嗚В鍐炽��
鍗佷節銆乀oo many connections (1040)閾炬帴杩囧
缈昏瘧锛氳揪鍒版渶澶ц繛鎺ユ暟
闂鍒嗘瀽锛�
杩炴帴鏁拌秴杩囦簡mysql璁剧疆鐨勫�硷紝涓巑ax_connections 鍜寃ait_timeout 閮芥湁鍏崇郴銆倃ait_timeout鐨勫�艰秺澶э紝杩炴帴鐨勭┖闂茬瓑寰呭氨瓒婇暱锛岃繖鏍峰氨浼氶�犳垚褰撳墠杩炴帴鏁拌秺澶�
瑙e喅鏂规硶锛�
1.铏氭嫙涓绘満鐢ㄦ埛璇疯仈绯荤┖闂村晢浼樺寲 MySQL 鏈嶅姟鍣ㄧ殑閰嶇疆锛�
2.鐙珛涓绘満鐢ㄦ埛璇疯仈绯绘湇鍔″櫒绠$悊鍛樹紭鍖� MySQL 鏈嶅姟鍣ㄧ殑閰嶇疆锛屽彲鍙傝�冿細
淇敼 MySQL 閰嶇疆鏂囦欢 my.ini 鎴栬�� my.cnf 涓殑鍙傛暟锛�
max_connections= 1000
wait_timeout = 10
淇敼鍚庨噸鍚� MySQL 锛屽鏋滅粡甯告�х殑鎶ユ閿欒锛岃鍋氫竴涓嬫湇鍔″櫒鐨勬暣浣撲紭鍖栥��
浜屽崄銆乀here is no such grant defined for user '%s' on host '%s'
閿欒缂栧彿锛�1141
闂鍒嗘瀽锛�
MySQL 褰撳墠鐢ㄦ埛鏃犳潈璁块棶鏁版嵁搴撱��
瑙e喅鏂规硶锛�
1銆佽櫄鎷熶富鏈虹敤鎴疯鑱旂郴绌洪棿鍟嗭紝纭缁欎綘鎻愪緵鐨勫笎鍙锋槸鍚︽湁鎺堟潈鏁版嵁搴撶殑鏉冮檺銆�
2銆佺嫭绔嬩富鏈虹敤鎴疯鑱旂郴鏈嶅姟鍣ㄧ鐞嗗憳锛岀‘璁ょ粰鎮ㄦ彁渚涚殑鏁版嵁搴撳笎鍙锋槸鍚︽湁绠$悊姝ゆ暟鎹簱鐨勬潈闄愩��
浜屽崄涓�銆丒rror on rename of '%s' to '%s' (errno: %d)
error.:1025
闂鍒嗘瀽锛�
璇锋鏌ヤ竴涓嬫偍鐨勭▼搴忔槸鍚︽湁淇敼鏁版嵁搴撹〃鍚嶇殑璇彞銆�
瑙e喅鏂规硶锛�
1.璇锋鏌ユ偍鐨勭▼搴忎腑鍝簺鍦版柟闇�瑕佷慨鏀规暟鎹簱琛ㄥ悕锛�
2.濡傛灉鎮ㄧ殑瀹為檯搴旂敤纭疄闇�瑕佷慨鏀瑰埌鏁版嵁搴撹〃鍚嶇殑璇濓紝璇疯仈绯荤┖闂村晢鎴栬�呮湇鍔″櫒绠$悊鍛樼粰鎮ㄥ紑鏀句慨鏀瑰簱鍚嶇殑鏉冮檺鍜屾湇鍔″櫒鏈韩鏄惁姝e父銆�
浜屽崄浜屻�丒rror reading file '%s' (errno: %d)
error.:1023
闂鍒嗘瀽锛�
鏁版嵁搴撴枃浠朵笉鑳借璇诲彇銆�
瑙e喅鏂规硶锛�
1.铏氭嫙涓绘満鐢ㄦ埛璇疯仈绯荤┖闂村晢鏌ョ湅鏁版嵁搴撴槸鍚﹀畬濂姐��
2.鐙珛涓绘満鐢ㄦ埛璇疯仈绯绘湇鍔″櫒绠$悊鍛樻鏌ヤ竴涓� MySQL 鏈韩鏄惁姝e父锛� MySQL 鏄惁鍙互璇诲彇鏂囦欢锛孡inux 鐢ㄦ埛鍙互妫�鏌ヤ竴涓� MySQL 鐨勬暟鎹簱鏂囦欢鐨勫睘涓绘槸鍚︽纭互鍙婃湰韬殑鏂囦欢鏄惁鎹熷潖銆�
浜屽崄涓夈�丠ost '*****' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
error.:1129
闂鍒嗘瀽锛�
鏁版嵁搴撳嚭鐜板紓甯革紝璇烽噸鍚暟鎹簱銆�
瑙e喅鏂规硶锛�
1. 鐢变簬瀛樺湪寰堝杩炴帴閿欒锛屼富鏈�'****'琚睆钄斤紝铏氭嫙涓绘満鐢ㄦ埛璇疯仈绯荤┖闂村晢澶勭悊锛岀嫭绔嬩富鏈虹敤鎴疯鑱旂郴鏈嶅姟鍣ㄧ鐞嗗憳锛屽湪 MySQL 鐨勫懡浠ゆ帶鍒跺彴涓嬫墽琛�'mysqladmin flush-hosts'瑙i櫎灞忚斀鍗冲彲锛屾垨鑰呴噸鍚� MySQL 鏁版嵁搴�
浜屽崄鍥涖�乨ropping database (can't delete '%s', errno: %d)
error.:1009
闂鍒嗘瀽锛�
涓嶈兘鍒犻櫎鏁版嵁搴撴枃浠讹紝瀵艰嚧鍒犻櫎鏁版嵁搴撳け璐ャ��
瑙e喅鏂规硶锛�
1.妫�鏌ユ偍浣跨敤鐨勬暟鎹簱绠$悊甯愬彿鏄惁鏈夋潈闄愬垹闄ゆ暟鎹��
2.妫�鏌ユ暟鎹簱鏄惁瀛樺湪銆�
浜屽崄浜斻�丟ot error 28 from table handler
error.:1030
闂鍒嗘瀽锛�
鏁版嵁搴撴墍鍦ㄧ鐩樼┖闂村凡婊°��
瑙e喅鏂规硶锛�
1.铏氭嫙涓绘満鐢ㄦ埛璇疯仈绯荤┖闂村晢澧炲姞 MySQL 鎵�鍦ㄧ殑纾佺洏绌洪棿鎴栬�呮竻鐞嗕竴浜涙棤鐢ㄦ枃浠讹紱
2.鐙珛涓绘満鐢ㄦ埛璇疯仈绯绘湇鍔″櫒绠$悊鍛樺鍔� MySQL 鎵�鍦ㄧ殑纾佺洏绌洪棿鎴栬�呮竻鐞嗕竴浜涙棤鐢ㄦ枃浠�
浜屽崄鍏�丆an't create a new thread; if you are not out of available memory, you can consult the manual for a possible OS-dependent bug銆�
error.:11/35
闂鍒嗘瀽锛�
鏁版嵁搴撴湇鍔″櫒闂锛屾暟鎹簱鎿嶄綔鏃犳硶鍒涘缓鏂扮嚎绋嬨�備竴鑸槸涓や釜鍘熷洜锛�
1.鏈嶅姟鍣ㄧ郴缁熷唴瀛樻孩鍑恒��
2.鐜杞欢鎹熷潖鎴栫郴缁熸崯鍧忋��
瑙e喅鏂规硶锛�
1.铏氭嫙涓绘満鐢ㄦ埛璇疯仈绯讳笅绌洪棿鍟嗘暟鎹簱鏈嶅姟鍣ㄧ殑鍐呭瓨鍜岀郴缁熸槸鍚︽甯搞��
2.鐙珛涓绘満鐢ㄦ埛璇疯仈绯绘湇鍔″櫒绠$悊鍛樻鏌ユ湇鍔″櫒鐨勫唴瀛樺拰绯荤粺鏄惁姝e父锛屽鏋滄湇鍔″櫒鍐呭瓨绱у紶锛岃妫�鏌ヤ竴涓嬪摢浜涜繘绋嬫秷鑰椾簡鏈嶅姟鍣ㄧ殑鍐呭瓨锛屽悓鏃惰�冭檻鏄惁澧炲姞鏈嶅姟鍣ㄧ殑鍐呭瓨鏉ユ彁楂樻暣涓殑璐熻浇鑳藉姏銆�
浜屽崄涓冦�丒rror: Client does not support authentication protocol requested by server; consider upgrading MySQL client
error.:1251
闂鍒嗘瀽锛�
濡傛灉浣犲崌绾� MySQL 鍒� 4.1 浠ヤ笂鐗堟湰鍚庨亣鍒颁互涓婇棶棰�,璇峰厛纭畾浣犵殑 MySQL Client 鏄� 4.1 鎴栬�呮洿楂樼増鏈�(Windows涓嬫湁闂浣犲氨鐩存帴璺冲埌涓嬮潰鐪嬭В鍐虫柟娉曚簡锛屽洜涓� MySQL 鍦� Windows 鏄� client 鍜� server 涓�璧疯涓婁簡鐨�)銆�
瑙e喅鏂规硶锛�
1. Windows 骞冲彴
涓昏鏄敼鍙樿繛鎺� MySQL 鐨勫笎鎴风殑鍔犲瘑鏂瑰紡锛孧ySQL 4.1/5.0 鏄�氳繃 PASSWORD 杩欑鏂瑰紡鍔犲瘑鐨勩�傚彲浠ラ�氳繃浠ヤ笅涓ょ鏂规硶寰楀埌瑙e喅锛�
1) mysql->SET PASSWORD FOR 'some_user'@'some_host'=OLD_PASSWORD('new_password');
2) mysql->UPDATE mysql.user SET Password=OLD_PASSWORD('new_password') WHERE Host='some_host' AND User='some_user';
2. Linux/Unix 骞冲彴
Linux 骞冲彴涓嬮鍏堢‘瀹氭槸鍚﹀畨瑁呰繃 MySQL 鐨勫鎴风锛岃繖涓敤 rpm 瀹夎寰堢畝鍗曪紝Linux 浠g爜涓猴細
rpm -ivh MySQL-client-4.1.15-0.i386.rpm
鐒跺悗鍦ㄧ紪璇� php 鐨勬椂鍊欒鍔犱笂锛�
--with-mysql=/your/path/to/mysql
涓�鑸儏鍐典笅閮藉彲浠ヨВ鍐炽�傚鏋滆繕鍑虹幇杩欑閿欒锛屽彲浠ユ寜鐓т笅闈㈢殑鏂规硶鏉ュ仛锛�
mysql->SET PASSWORD FOR 'some_user'@'some_host'=OLD_PASSWORD('new_password');
mysql->UPDATE mysql.user SET Password=OLD_PASSWORD('new_password') WHERE Host='some_host' AND User='some_user';
浜屽崄鍏�丒rror: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
error.:2002
闂鍒嗘瀽锛�
鍑虹幇杩欎釜閿欒涓�鑸儏鍐典笅鏄洜涓轰笅闈袱涓師鍥狅細
1.MySQL 鏈嶅姟鍣ㄦ病鏈夊紑鍚��
2.MySQL 鏈嶅姟鍣ㄥ紑鍚簡锛屼絾涓嶈兘鎵惧埌 socket 鏂囦欢銆�
瑙e喅鏂规硶锛�
1.铏氭嫙涓绘満鐢ㄦ埛锛岃鑱旂郴绌洪棿鍟嗙‘璁ゆ暟鎹簱鏄惁姝e父鍚姩銆�
2.鐙珛涓绘満鐢ㄦ埛锛岃妫�鏌ヤ竴涓� MySQL 鏈嶅姟鏄惁宸茬粡寮�鍚紝娌℃湁寮�鍚紝璇峰惎鍔� MySQL 鏈嶅姟锛涘鏋滃凡缁忓紑鍚紝骞朵笖鏄� Linux 绯荤粺锛岃妫�鏌ヤ竴涓� MySQL 鐨� socket 鐨勮矾寰勶紝鐒跺悗鎵撳紑 config.inc.php 鎵惧埌
$dbhost = 'localhost'; 鍦� hostname 鍚庨潰鍔犲啋鍙封��:鈥欏拰 MySQL 鐨� socket 鐨勮矾寰勩��
姣斿 MySQL 鏈嶅姟鍣ㄤ负 localhost
MySQL 鐨� socket 鐨勮矾寰勪负 /tmp/mysql.sock
閭d箞灏辨敼鎴愬涓嬶細
$dbhost = 'localhost:/temp/mysql.sock';
浜屽崄涔濄�丆an't connect to MySQL server on 'localhost'
error.:2003
闂鍒嗘瀽锛�
MySQL 鏈嶅姟娌℃湁鍚姩锛屼竴鑸槸鍦ㄥ紓甯哥殑鎯呭喌涓� MySQL 鏃犳硶鍚姩瀵艰嚧鐨勶紝姣斿鏃犲彲鐢ㄧ殑纾佺洏绌洪棿锛宮y.ini 閲� MySQL 鐨� basedir 璺緞璁剧疆閿欒绛夈��
瑙e喅鏂规硶锛�
1.妫�鏌ョ鐩樼┖闂存槸鍚﹁繕鏈夊墿浣欏彲鐢ㄧ┖闂达紝灏介噺淇濇寔鏈夎冻澶熺殑纾佺洏绌洪棿鍙敤銆�
2.妫�鏌� my.ini 閲岀殑 basedir 绛夊弬鏁拌缃槸鍚︽纭紝鐒跺悗閲嶆柊鍚姩涓� MySQL 鏈嶅姟銆�
涓夊崄銆丩ost connection to MySQL server during query
error.:2013
闂鍒嗘瀽锛�
鏁版嵁搴撴煡璇㈣繃绋嬩腑涓㈠け浜嗕笌 MySQL 鏈嶅姟鍣ㄧ殑杩炴帴銆�
瑙e喅鏂规硶锛�
1.璇风‘璁ゆ偍鐨勭▼搴忎腑鏄惁鏈夋晥鐜囧緢浣庣殑绋嬪簭锛屾瘮濡傛煇浜涙彃浠讹紝鍙互鍗歌浇鎺夋彃浠讹紝妫�鏌ヤ竴涓嬫湇鍔″櫒鏄惁姝e父锛�
2.鏈嶅姟鍣ㄦ湰韬祫婧愮揣寮狅紝铏氭嫙涓绘満鐢ㄦ埛璇疯仈绯荤┖闂村晢纭锛岀嫭绔嬩富鏈虹敤鎴疯鑱旂郴鏈嶅姟鍣ㄧ鐞嗗憳锛屾鏌ヤ竴涓嬫湇鍔″櫒鏄惁姝e父銆�
涓夊崄涓�銆丟ot a packet bigger than \'max_allowed_packet\' bytes
閿欒缂栧彿锛�1153
闂鍒嗘瀽锛氳皟鏁翠簡 Mantis 鐨勪笂浼犻檮浠剁殑澶у皬鍗存病鏈夎皟鏁� MySQL 鐨勯厤缃枃浠躲��
瑙e喅鍔炴硶锛�
1銆佺嫭绔嬩富鏈虹敤鎴疯鎸夌収浠ヤ笅鏂规硶璋冩暣锛�
鏌ユ壘 MySQL 鐨勯厤缃枃浠讹紙my.cnf 鎴栬�� my.ini锛�
鍦� [mysqld] 閮ㄥ垎娣诲姞涓�鍙ワ紙濡傛灉瀛樺湪锛岃皟鏁村叾鍊煎氨鍙互锛夛細
max_allowed_packet=10M
閲嶅惎 MySQL 鏈嶅姟灏卞彲浠ヤ簡銆傝繖閲岃缃殑鏄� 10MB銆�
2銆佽櫄鎷熶富鏈虹敤鎴疯鑱旂郴绌洪棿鍟嗚皟鏁存鍙傛暟銆�