{"id":6075,"date":"2020-03-05T11:55:08","date_gmt":"2020-03-05T03:55:08","guid":{"rendered":"https:\/\/blog.naibabiji.com\/?p=6075"},"modified":"2020-03-05T11:55:08","modified_gmt":"2020-03-05T03:55:08","slug":"error-establishing-a-database-connection","status":"publish","type":"post","link":"https:\/\/blog.naibabiji.com\/tutorial\/error-establishing-a-database-connection.html","title":{"rendered":"\u81ea\u5df1\u5efa\u7f51\u7ad9\u78b0\u5230WordPress\u6570\u636e\u5e93\u51fa\u9519\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<p>\u65b0\u624b\u5728\u81ea\u5df1\u5efa\u7f51\u7ad9\u7684\u65f6\u5019\u6700\u6015\u78b0\u5230\u7f51\u7ad9\u51fa\u95ee\u9898\uff0c\u4f8b\u5982WordPress\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u63d0\u793aError Establishing a Database Connection\u3002\u5976\u7238\u8fd9\u91cc\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u6570\u636e\u5e93\u51fa\u9519\u540e\u7684\u51e0\u79cd\u68c0\u67e5\u65b9\u6cd5\u3002<\/p>\n<p><a href=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2020\/03\/1142G251.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6076\" src=\"https:\/\/edgeone.naibabiji.com\/wp-content\/uploads\/2020\/03\/1142G251.png\" alt=\"WordPress\u6570\u636e\u5e93\u8fde\u63a5\u9519\u8bef\" width=\"622\" height=\"156\" \/><\/a><\/p>\n<p>\u5f53\u4f60<a href=\"https:\/\/blog.naibabiji.com\/an-zhuang-wordpress\" target=\"_blank\" rel=\"noopener noreferrer\">\u5b89\u88c5\u597dWordPress\u7f51\u7ad9<\/a>\u540e\uff0c\u7a81\u7136\u6709\u4e00\u5929\u63d0\u793a\u4f60\u6570\u636e\u5e93\u8fde\u63a5\u9519\u8bef\uff0c\u90a3\u4e48\u6309\u7167\u4e0b\u9762\u8fd9\u4e9b\u65b9\u6cd5\u68c0\u67e5\u3002<\/p>\n<h3>\u4e00\u3001\u68c0\u67e5\u6570\u636e\u5e93\u8fdb\u7a0b\u662f\u5426\u6b63\u5e38<\/h3>\n<p>\u5982\u679c\u4f60\u662f\u81ea\u5df1\u8d2d\u4e70\u7684<a href=\"https:\/\/blog.naibabiji.com\/tutorial\/install-bt.html\">VPS\u5b89\u88c5\u5b9d\u5854\u9762\u677f<\/a>\u7684\u8bdd\uff0c\u90a3\u4e48\u5148\u767b\u5f55\u5b9d\u5854\u540e\u53f0\uff0c\u770b\u770bMySQL\u8fdb\u7a0b\u662f\u5426\u6b63\u5e38\u8fd0\u884c\uff0c\u6ca1\u6709\u6b63\u5e38\u8fd0\u884c\u7684\u8bdd\uff0c\u5c31\u91cd\u542f\u4e00\u6b21\u3002<\/p>\n<p>\u5982\u679c\u8fdb\u7a0b\u65e0\u6cd5\u91cd\u542f\uff0c\u90a3\u4e48\u53ef\u4ee5\u8003\u8651\u91cd\u542f\u4e0b\u670d\u52a1\u5668\u3002<\/p>\n<h3>\u4e8c\u3001\u6062\u590d\u4e4b\u524d\u7684\u6570\u636e\u5e93\u5907\u4efd<\/h3>\n<p>\u5982\u679c\u4f60\u662f\u4f7f\u7528\u7684\u865a\u62df\u4e3b\u673a\uff0c\u90a3\u4e48\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\u901a\u5e38\u53ef\u80fd\u662f\u6570\u636e\u5e93\u51fa\u4e86\u95ee\u9898\uff0c\u4f60\u53ef\u4ee5\u767b\u5f55\u865a\u62df\u673a\u7ba1\u7406\u540e\u53f0\uff0c\u8fdb\u5165\u6570\u636e\u5e93\u7ba1\u7406\u754c\u9762\u3002\u4f8b\u5982phpmyadmin\uff0c\u628a\u73b0\u5728\u7684\u6570\u636e\u5e93\u5148\u5907\u4efd\u4e00\u6b21\uff0c\u7136\u540e\u6062\u590d\u4e4b\u524d\u7684\u8001\u5907\u4efd\u3002<\/p>\n<h3>\u4e09\u3001\u68c0\u67e5\u4e3b\u9898\u548c\u63d2\u4ef6<\/h3>\n<p>\u6709\u4e9b\u65f6\u5019\uff0c\u4e3b\u9898\u548c\u63d2\u4ef6bug\u4e5f\u4f1a\u5bfc\u81f4\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528FTP\u8f6f\u4ef6\u628a\u6240\u6709\u63d2\u4ef6\u548c\u975e\u9ed8\u8ba4\u4e3b\u9898\u90fd\u5148\u6539\u540d\u6216\u8005\u79fb\u52a8\u5230\u5176\u4ed6\u6587\u4ef6\u5939\uff0c\u786e\u4fdd\u7f51\u7ad9\u53ef\u4ee5\u6253\u5f00\u540e\uff0c\u518d\u4e00\u4e00\u8fd8\u539f\u6d4b\u8bd5\u95ee\u9898\u51fa\u5728\u54ea\u91cc\u3002<\/p>\n<h3>\u56db\u3001\u91cd\u65b0\u5b89\u88c5WordPress\u6838\u5fc3\u6587\u4ef6<\/h3>\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u8ddf<a href=\"https:\/\/blog.naibabiji.com\/tutorial\/wordpress-sheng-ji-jiao-cheng.html#fang_fa_yi_xia_zai_li_xian_bao_shou_dong_geng_xin\">\u624b\u52a8\u66f4\u65b0WordPress\u7248\u672c<\/a>\u4e00\u6837\uff0c\u4e0b\u8f7d<a href=\"https:\/\/blog.naibabiji.com\/files\/wordpress-xia-zai.html\">\u65b0\u7248\u672c\u7684WordPress\u5b89\u88c5\u5305<\/a>\uff0c\u7136\u540e\u628a\u65b0\u7684\u5b89\u88c5\u5305\u6587\u4ef6\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u66ff\u6362\u6389\u73b0\u6709\u6587\u4ef6\u3002<\/p>\n<h3>\u4e94\u3001\u5c1d\u8bd5WordPress\u81ea\u52a8\u4fee\u590d\u6570\u636e\u5e93<\/h3>\n<p>\u4f7f\u7528FTP\u6216\u8005\u5b9d\u5854\u7684\u6587\u4ef6\u7f16\u8f91\u529f\u80fd\u6253\u5f00\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u7684wp-config.php\u6587\u4ef6\uff0c\u6dfb\u52a0\u4e0a<code>define('WP_ALLOW_REPAIR', true);<\/code><\/p>\n<p>\u7136\u540e\u901a\u8fc7\u4f60\u57df\u540d\u52a0<code>wp-admin\/maint\/repair.php<\/code>\u7684\u8def\u5f84\u8bbf\u95ee\u7f51\u7ad9\uff0c\u4f1a\u51fa\u73b0\u6570\u636e\u5e93\u4fee\u590d\u548c\u4f18\u5316\u754c\u9762\u3002<\/p>\n<h3>\u603b\u7ed3<\/h3>\n<p>WordPress\u78b0\u5230\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\u7684\u95ee\u9898\u7ecf\u5e38\u90fd\u6709\u4eba\u4f1a\u78b0\u5230\uff0c\u5927\u591a\u6570\u60c5\u51b5\u90fd\u662f\u670d\u52a1\u5668\u5185\u5b58\u4e0d\u591f\u6570\u636e\u5e93\u8fdb\u7a0b\u6302\u4e86\uff0c\u4e0d\u8fc7\u865a\u62df\u4e3b\u673a\u7684\u8bdd\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5\u6bd4\u8f83\u5c11\uff0c\u95ee\u9898\u591a\u534a\u51fa\u5728\u7f51\u7ad9\u672c\u8eab\u4e0a\uff0c\u9700\u8981\u81ea\u5df1\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4e00\u4e00\u5224\u65ad\u3002<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;6075&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;2&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;\u7ed9\u672c\u6587\u6253\u5206 post&quot;,&quot;legend&quot;:&quot;5\\\/5 - (2 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;\u81ea\u5df1\u5efa\u7f51\u7ad9\u78b0\u5230WordPress\u6570\u636e\u5e93\u51fa\u9519\u600e\u4e48\u529e\uff1f&quot;,&quot;width&quot;:&quot;138&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 138px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            5\/5 - (2 votes)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u65b0\u624b\u5728\u81ea\u5df1\u5efa\u7f51\u7ad9\u7684\u65f6\u5019\u6700\u6015\u78b0\u5230\u7f51\u7ad9\u51fa\u95ee\u9898\uff0c\u4f8b\u5982WordPress\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u63d0\u793aError Establi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"\u81ea\u5df1\u5efa\u7f51\u7ad9\u78b0\u5230WordPress\u6570\u636e\u5e93\u51fa\u9519\u600e\u4e48\u529e\uff1f - \u5976\u7238\u5efa\u7ad9\u7b14\u8bb0","description":"\u65b0\u624b\u5728\u81ea\u5df1\u5efa\u7f51\u7ad9\u7684\u65f6\u5019\u6700\u6015\u78b0\u5230\u7f51\u7ad9\u51fa\u95ee\u9898\uff0c\u4f8b\u5982WordPress\u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff0c\u63d0\u793aError Establishing a Database Connection\u3002\u5976\u7238\u8fd9\u91cc\u7ed9\u5927\u5bb6\u5206\u4eab\u4e00\u4e0b\u6570\u636e\u5e93\u51fa\u9519\u540e\u7684\u51e0\u79cd\u68c0\u67e5\u65b9\u6cd5\u3002 \u5f53\u4f60 \u5b89\u88c5\u597dWordPress\u7f51\u7ad9 \u540e\uff0c\u7a81\u7136\u6709\u4e00\u5929\u63d0\u793a\u4f60\u6570\u636e\u5e93\u8fde\u63a5\u9519\u8bef\uff0c\u90a3\u4e48\u6309\u7167\u4e0b\u9762\u8fd9\u4e9b\u65b9\u6cd5\u68c0\u67e5\u3002 \u4e00"},"footnotes":""},"categories":[141],"tags":[],"class_list":["post-6075","post","type-post","status-publish","format-standard","hentry","category-tutorial"],"_links":{"self":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/6075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/comments?post=6075"}],"version-history":[{"count":0,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/posts\/6075\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/media?parent=6075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/categories?post=6075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.naibabiji.com\/wp-json\/wp\/v2\/tags?post=6075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}