{"id":121197,"date":"2025-12-02T09:00:00","date_gmt":"2025-12-02T02:00:00","guid":{"rendered":"https:\/\/tino.vn\/blog\/?p=121197"},"modified":"2026-01-02T16:49:57","modified_gmt":"2026-01-02T09:49:57","slug":"sua-loi-error-establishing-a-database-connection","status":"publish","type":"post","link":"https:\/\/tino.vn\/blog\/sua-loi-error-establishing-a-database-connection\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn s\u1eeda l\u1ed7i Error Establishing A Database Connection trong WordPress [2026]"},"content":{"rendered":"\n<p><strong>Trong qu\u00e1 tr\u00ecnh s\u1eed d\u1ee5ng <a href=\"https:\/\/tino.vn\/blog\/wordpress-la-gi\/\" target=\"_blank\" data-type=\"post\" data-id=\"15589\" rel=\"noreferrer noopener\">WordPress<\/a>, kh\u00f4ng \u00edt ng\u01b0\u1eddi d\u00f9ng \u0111\u00e3 g\u1eb7p ph\u1ea3i l\u1ed7i &#8220;Error Establishing A Database Connection&#8221;. \u0110\u00e2y l\u00e0 m\u1ed9t trong nh\u1eefng v\u1ea5n \u0111\u1ec1 ph\u1ed5 bi\u1ebfn v\u00e0 g\u00e2y kh\u00f3 ch\u1ecbu nh\u1ea5t \u0111\u1ed1i v\u1edbi c\u00e1c qu\u1ea3n tr\u1ecb vi\u00ean website. Khi l\u1ed7i n\u00e0y x\u1ea3y ra, trang web c\u1ee7a b\u1ea1n s\u1ebd kh\u00f4ng th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c, l\u00e0m \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn tr\u1ea3i nghi\u1ec7m ng\u01b0\u1eddi d\u00f9ng v\u00e0 ho\u1ea1t \u0111\u1ed9ng kinh doanh. B\u00e0i vi\u1ebft d\u01b0\u1edbi \u0111\u00e2y s\u1ebd cung c\u1ea5p cho b\u1ea1n nh\u1eefng h\u01b0\u1edbng d\u1eabn chi ti\u1ebft \u0111\u1ec3 s\u1eeda l\u1ed7i Error Establishing A Database Connection trong WordPress \u0111\u01a1n gi\u1ea3n, gi\u00fap b\u1ea1n nhanh ch\u00f3ng kh\u00f4i ph\u1ee5c website c\u1ee7a m\u00ecnh v\u1ec1 tr\u1ea1ng th\u00e1i ho\u1ea1t \u0111\u1ed9ng.<\/strong><\/p>\n\n\n\n<h2 id=\"L\u1ed7i_&#8220;Error_Establishing_A_Database_Connection&#8221;_l\u00e0_g\u00ec?\"><a id=\"post-121197-_dnkgetyyath5\"><\/a>L\u1ed7i &#8220;Error Establishing A Database Connection&#8221; l\u00e0 g\u00ec?<\/h2>\n\n\n\n<p>L\u1ed7i &#8220;Error Establishing a Database Connection&#8221; (hay c\u00f2n g\u1ecdi l\u00e0 <em>L\u1ed7i thi\u1ebft l\u1eadp k\u1ebft n\u1ed1i c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/em>) trong WordPress l\u00e0 m\u1ed9t th\u00f4ng b\u00e1o l\u1ed7i xu\u1ea5t hi\u1ec7n tr\u00ean tr\u00ecnh duy\u1ec7t web khi website kh\u00f4ng th\u1ec3 k\u1ebft n\u1ed1i v\u00e0 giao ti\u1ebfp v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u1ee7a m\u00ecnh.<\/p>\n\n\n\n<p>C\u01a1 s\u1edf d\u1eef li\u1ec7u l\u00e0 n\u01a1i l\u01b0u tr\u1eef t\u1ea5t c\u1ea3 n\u1ed9i dung, c\u00e0i \u0111\u1eb7t, b\u00e0i vi\u1ebft, trang, b\u00ecnh lu\u1eadn v\u00e0 c\u00e1c d\u1eef li\u1ec7u quan tr\u1ecdng kh\u00e1c c\u1ee7a website WordPress. Khi l\u1ed7i n\u00e0y x\u1ea3y ra, website s\u1ebd kh\u00f4ng th\u1ec3 hi\u1ec3n th\u1ecb b\u1ea5t k\u1ef3 n\u1ed9i dung n\u00e0o. Thay v\u00e0o \u0111\u00f3, ng\u01b0\u1eddi d\u00f9ng s\u1ebd th\u1ea5y th\u00f4ng b\u00e1o &#8220;Error Establishing a Database Connection&#8221;. \u0110i\u1ec1u n\u00e0y c\u00f3 ngh\u0129a l\u00e0 m\u00e1y ch\u1ee7 web kh\u00f4ng th\u1ec3 t\u00ecm th\u1ea5y, truy c\u1eadp ho\u1eb7c x\u00e1c th\u1ef1c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh trong c\u1ea5u h\u00ecnh c\u1ee7a WordPress. Do \u0111\u00f3, to\u00e0n b\u1ed9 website s\u1ebd t\u1ea1m th\u1eddi kh\u00f4ng ho\u1ea1t \u0111\u1ed9ng cho \u0111\u1ebfn khi k\u1ebft n\u1ed1i \u0111\u01b0\u1ee3c kh\u00f4i ph\u1ee5c.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-1.png\" alt=\"L\u1ed7i &quot;Error Establishing A Database Connection&quot; l\u00e0 g\u00ec?\" class=\"wp-image-121198\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-1.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-1-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>L\u1ed7i &#8220;Error Establishing A Database Connection&#8221; l\u00e0 g\u00ec?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<h3 id=\"Nguy\u00ean_nh\u00e2n_g\u00e2y_ra_l\u1ed7i_&#8220;Error_Establishing_A_Database_Connection&#8221;_trong_WordPress\"><a id=\"post-121197-_7o72le96ng81\"><\/a><strong>Nguy\u00ean nh\u00e2n g\u00e2y ra l\u1ed7i &#8220;Error Establishing A Database Connection&#8221; trong WordPress<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Th\u00f4ng tin \u0111\u0103ng nh\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u b\u1ecb sai:<\/strong> Th\u00f4ng tin trong t\u1ec7p wp-config.php (g\u1ed3m t\u00ean database, username, m\u1eadt kh\u1ea9u, host) kh\u00f4ng ch\u00ednh x\u00e1c do g\u00f5 nh\u1ea7m, \u0111\u1ed5i m\u1eadt kh\u1ea9u nh\u01b0ng qu\u00ean c\u1eadp nh\u1eadt file c\u1ea5u h\u00ecnh, ho\u1eb7c l\u1ed7i c\u00fa ph\u00e1p khi ch\u1ec9nh s\u1eeda.<\/li>\n\n\n\n<li><strong>M\u00e1y ch\u1ee7 database qu\u00e1 t\u1ea3i ho\u1eb7c g\u1eb7p s\u1ef1 c\u1ed1:<\/strong> M\u00e1y ch\u1ee7 l\u01b0u tr\u1eef (MySQL) b\u1ecb &#8220;s\u1eadp&#8221; do l\u01b0\u1ee3ng truy c\u1eadp t\u0103ng \u0111\u1ed9t bi\u1ebfn, l\u1ed7i ph\u1ea7n c\u1ee9ng ho\u1eb7c \u0111ang b\u1ea3o tr\u00ec. L\u1ed7i n\u00e0y r\u1ea5t ph\u1ed5 bi\u1ebfn tr\u00ean c\u00e1c g\u00f3i shared hosting khi t\u00e0i nguy\u00ean b\u1ecb chia s\u1ebb qu\u00e1 m\u1ee9c.<\/li>\n\n\n\n<li><strong>C\u01a1 s\u1edf d\u1eef li\u1ec7u (database) b\u1ecb h\u1ecfng:<\/strong> B\u1ea3n th\u00e2n d\u1eef li\u1ec7u b\u1ecb l\u1ed7i c\u1ea5u tr\u00fac do xung \u0111\u1ed9t ph\u1ea7n m\u1ec1m (plugin\/theme), l\u1ed7i \u1ed5 c\u1ee9ng m\u00e1y ch\u1ee7 ho\u1eb7c b\u1ecb hacker t\u1ea5n c\u00f4ng, khi\u1ebfn WordPress kh\u00f4ng th\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li><strong>T\u1ec7p <\/strong><strong>wp-config.php<\/strong><strong> b\u1ecb h\u1ecfng ho\u1eb7c thi\u1ebfu:<\/strong> T\u1ec7p c\u1ea5u h\u00ecnh quan tr\u1ecdng nh\u1ea5t n\u00e0y b\u1ecb l\u1ed7i n\u1ed9i dung (do ch\u1ec9nh s\u1eeda sai, nhi\u1ec5m virus) ho\u1eb7c b\u1ecb x\u00f3a m\u1ea5t, l\u00e0m m\u1ea5t c\u1ea7u n\u1ed1i li\u00ean k\u1ebft gi\u1eefa m\u00e3 ngu\u1ed3n v\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li><strong>V\u1ea5n \u0111\u1ec1 t\u1eeb ph\u00eda m\u00e1y ch\u1ee7 web:<\/strong> Do c\u1ea5u h\u00ecnh sai tr\u00ean server ho\u1eb7c t\u01b0\u1eddng l\u1eeda ch\u1eb7n nh\u1ea7m k\u1ebft n\u1ed1i \u0111\u1ebfn c\u01a1 s\u1edf d\u1eef li\u1ec7u, d\u00f9 th\u00f4ng tin \u0111\u0103ng nh\u1eadp ho\u00e0n to\u00e0n \u0111\u00fang.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-2.png\" alt=\"Nguy\u00ean nh\u00e2n g\u00e2y ra l\u1ed7i &quot;Error Establishing A Database Connection&quot; trong WordPress\" class=\"wp-image-121199\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-2.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-2-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Nguy\u00ean nh\u00e2n g\u00e2y ra l\u1ed7i &#8220;Error Establishing A Database Connection&#8221; trong WordPress<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<h2 id=\"H\u01b0\u1edbng_d\u1eabn_c\u00e1ch_s\u1eeda_l\u1ed7i_Error_Establishing_A_Database_Connection_trong_WordPress\"><a id=\"post-121197-_jzcxnabyb6v0\"><\/a><strong>H\u01b0\u1edbng d\u1eabn c\u00e1ch s\u1eeda l\u1ed7i Error Establishing A Database Connection trong WordPress<\/strong><\/h2>\n\n\n\n<h3 id=\"Ki\u1ec3m_tra_th\u00f4ng_tin_k\u1ebft_n\u1ed1i_trong_t\u1ec7p_wp-config.php\"><a id=\"post-121197-_myzsfq3rkuts\"><\/a><strong>Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php<\/strong><\/h3>\n\n\n\n<p>\u0110\u00e2y l\u00e0 b\u01b0\u1edbc quan tr\u1ecdng nh\u1ea5t, v\u00ec l\u1ed7i n\u00e0y th\u01b0\u1eddng do th\u00f4ng tin \u0111\u0103ng nh\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u kh\u00f4ng ch\u00ednh x\u00e1c.<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 1: <\/strong>Truy c\u1eadp t\u1ec7p wp-config.php. T\u1ec7p n\u00e0y n\u1eb1m trong th\u01b0 m\u1ee5c g\u1ed1c c\u1ee7a website WordPress. B\u1ea1n c\u00f3 th\u1ec3 truy c\u1eadp b\u1eb1ng<strong> FTP (<\/strong>ch\u1eb3ng h\u1ea1n nh\u01b0<strong> <\/strong><a href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/filezilla-project.org\/\" rel=\"noreferrer noopener nofollow\">Filezilla<\/a><strong>)<\/strong> ho\u1eb7c <strong>File Manager<\/strong> trong cPanel c\u1ee7a <a href=\"https:\/\/tino.vn\/hosting-gia-re\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/tino.vn\/hosting-gia-re\" rel=\"noreferrer noopener\">hosting.<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-4.png\" alt=\"Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php\" class=\"wp-image-121200\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-4.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-4-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php<\/strong><\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-5.png\" alt=\"Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php\" class=\"wp-image-121201\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-5.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-5-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><strong>B\u01b0\u1edbc 2: <\/strong>Ki\u1ec3m tra c\u00e1c h\u1eb1ng s\u1ed1 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>DB_NAME: <\/strong>T\u00ean c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li><strong>DB_USER:<\/strong> T\u00ean ng\u01b0\u1eddi d\u00f9ng c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li><strong>DB_PASSWORD: <\/strong>M\u1eadt kh\u1ea9u ng\u01b0\u1eddi d\u00f9ng c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li><strong>DB_HOST:<\/strong> M\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u (th\u01b0\u1eddng l\u00e0 localhost, nh\u01b0ng \u0111\u00f4i khi c\u00f3 th\u1ec3 kh\u00e1c, v\u00ed d\u1ee5: 127.0.0.1 ho\u1eb7c \u0111\u1ecba ch\u1ec9 IP c\u1ee5 th\u1ec3).<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-6.png\" alt=\"Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php\" class=\"wp-image-121202\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-6.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-6-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1ec7p wp-config.php<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><strong>B\u01b0\u1edbc 3: <\/strong>So s\u00e1nh v\u1edbi th\u00f4ng tin trong cPanel.<\/p>\n\n\n\n<p>B\u1ea1n \u0111\u0103ng nh\u1eadp v\u00e0o cPanel c\u1ee7a hosting, t\u00ecm \u0111\u1ebfn m\u1ee5c &#8220;<strong>MySQL Databases<\/strong>&#8221; ho\u1eb7c &#8220;<strong>phpMyAdmin<\/strong>&#8220;. Ki\u1ec3m tra xem th\u00f4ng tin c\u01a1 s\u1edf d\u1eef li\u1ec7u trong cPanel c\u00f3 kh\u1edbp v\u1edbi th\u00f4ng tin trong wp-config.php hay kh\u00f4ng.<\/p>\n\n\n\n<p>N\u1ebfu c\u00f3 b\u1ea5t k\u1ef3 s\u1ef1 kh\u00e1c bi\u1ec7t n\u00e0o, h\u00e3y s\u1eeda l\u1ea1i cho ch\u00ednh x\u00e1c trong wp-config.php.<\/p>\n\n\n\n<h3 id=\"Ki\u1ec3m_tra_m\u00e1y_ch\u1ee7_c\u01a1_s\u1edf_d\u1eef_li\u1ec7u\"><a id=\"post-121197-_4dhqlh6w2xle\"><\/a><strong>Ki\u1ec3m tra m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/strong><\/h3>\n\n\n\n<p>N\u1ebfu th\u00f4ng tin trong wp-config.php ch\u00ednh x\u00e1c, h\u00e3y ki\u1ec3m tra xem m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f3 ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng kh\u00f4ng.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ki\u1ec3m tra tr\u1ea1ng th\u00e1i m\u00e1y ch\u1ee7: <\/strong>Li\u00ean h\u1ec7 v\u1edbi nh\u00e0 cung c\u1ea5p hosting \u0111\u1ec3 ki\u1ec3m tra xem m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u (MySQL) c\u00f3 \u0111ang g\u1eb7p s\u1ef1 c\u1ed1 g\u00ec kh\u00f4ng (v\u00ed d\u1ee5: qu\u00e1 t\u1ea3i, b\u1ea3o tr\u00ec).<\/li>\n\n\n\n<li><strong>Truy c\u1eadp phpMyAdmin: <\/strong>N\u1ebfu b\u1ea1n c\u00f3 th\u1ec3 truy c\u1eadp phpMyAdmin trong cPanel, \u0111i\u1ec1u \u0111\u00f3 ch\u1ee9ng t\u1ecf m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111ang ho\u1ea1t \u0111\u1ed9ng. Th\u1eed \u0111\u0103ng nh\u1eadp v\u00e0o phpMyAdmin b\u1eb1ng th\u00f4ng tin \u0111\u0103ng nh\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u. N\u1ebfu b\u1ea1n kh\u00f4ng th\u1ec3 \u0111\u0103ng nh\u1eadp v\u00e0o phpMyAdmin, c\u00f3 th\u1ec3 c\u00f3 v\u1ea5n \u0111\u1ec1 v\u1edbi m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n<\/ul>\n\n\n\n<h3 id=\"S\u1eeda_ch\u1eefa_c\u01a1_s\u1edf_d\u1eef_li\u1ec7u\"><a id=\"post-121197-_a4w98n98vdj1\"><\/a><strong>S\u1eeda ch\u1eefa c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/strong><\/h3>\n\n\n\n<p>N\u1ebfu th\u00f4ng tin x\u00e1c th\u1ef1c l\u00e0 ch\u00ednh x\u00e1c nh\u01b0ng l\u1ed7i v\u1eabn ti\u1ebfp di\u1ec5n, c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f3 th\u1ec3 b\u1ecb h\u1ecfng. WordPress bao g\u1ed3m m\u1ed9t t\u00ednh n\u0103ng s\u1eeda ch\u1eefa t\u00edch h\u1ee3p:<\/p>\n\n\n\n<p>Th\u00eam d\u00f2ng sau v\u00e0o t\u1ec7p wp-config.php ngay tr\u01b0\u1edbc d\u00f2ng<code> <em>\/* That's all, stop editing! Happy blogging. *\/<\/em><\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_ALLOW_REPAIR', true);<\/code><\/pre>\n\n\n\n<p>L\u01b0u l\u1ea1i thay \u0111\u1ed5i v\u00e0 truy c\u1eadp v\u00e0o <em>http:\/\/yourdomain.com\/wp-admin\/maint\/repair.php<\/em> trong tr\u00ecnh duy\u1ec7t c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<p>L\u00e0m theo h\u01b0\u1edbng d\u1eabn \u0111\u1ec3 s\u1eeda ch\u1eefa v\u00e0 t\u1ed1i \u01b0u h\u00f3a c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/p>\n\n\n\n<p>Sau khi ho\u00e0n t\u1ea5t s\u1eeda ch\u1eefa, <strong>h\u00e3y x\u00f3a<\/strong> d\u00f2ng b\u1ea1n \u0111\u00e3 th\u00eam v\u00e0o wp-config.php \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o an to\u00e0n.<\/p>\n\n\n\n<h3 id=\"Kh\u00f4i_ph\u1ee5c_c\u00e0i_\u0111\u1eb7t_m\u1eb7c_\u0111\u1ecbnh_c\u1ee7a_PHP\"><a id=\"post-121197-_8kvmxtlps9m5\"><\/a><strong>Kh\u00f4i ph\u1ee5c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh c\u1ee7a PHP<\/strong><\/h3>\n\n\n\n<p>M\u1ed9t c\u00e1ch \u0111\u01a1n gi\u1ea3n nh\u01b0ng hi\u1ec7u qu\u1ea3 \u0111\u1ec3 s\u1eeda l\u1ed7i &#8220;Error Establishing A Database Connection&#8221; trong WordPress l\u00e0 kh\u00f4i ph\u1ee5c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh c\u1ee7a PHP.<\/p>\n\n\n\n<p>C\u00e1ch th\u1ef1c hi\u00ean nh\u01b0 sau:<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 1: <\/strong>Truy c\u1eadp v\u00e0o cPanel.<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 2: <\/strong>Ch\u1ecdn m\u1ee5c <strong>Selected PHP Version<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-7.png\" alt=\"Kh\u00f4i ph\u1ee5c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh c\u1ee7a PHP\" class=\"wp-image-121203\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-7.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-7-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Kh\u00f4i ph\u1ee5c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh c\u1ee7a PHP<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><strong>B\u01b0\u1edbc 3: <\/strong>Ch\u1ecdn tab <strong>Extensions<\/strong> -&gt; Ch\u1ecdn <strong>Reset to Default<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"400\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-8.png\" alt=\"Kh\u00f4i ph\u1ee5c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh c\u1ee7a PHP\" class=\"wp-image-121204\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-8.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/12\/sua-loi-Error-Establishing-A-Database-Connection-trong-WordPress-8-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Kh\u00f4i ph\u1ee5c c\u00e0i \u0111\u1eb7t m\u1eb7c \u0111\u1ecbnh c\u1ee7a PHP<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<h3 id=\"K\u1ebft_lu\u1eadn\"><a id=\"post-121197-_mvq9mijcdwgn\"><\/a><strong>K\u1ebft lu\u1eadn<\/strong><\/h3>\n\n\n\n<p>Sau khi \u0111\u00e3 th\u1ef1c hi\u1ec7n theo nh\u1eefng b\u01b0\u1edbc h\u01b0\u1edbng d\u1eabn tr\u00ean, b\u1ea1n s\u1ebd c\u00f3 kh\u1ea3 n\u0103ng kh\u1eafc ph\u1ee5c l\u1ed7i &#8220;Error Establishing A Database Connection&#8221; m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3. \u0110\u1eebng qu\u00ean ki\u1ec3m tra l\u1ea1i c\u00e1c th\u00f4ng tin c\u1ea5u h\u00ecnh v\u00e0 thi\u1ebft l\u1eadp c\u01a1 s\u1edf d\u1eef li\u1ec7u \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o m\u1ecdi th\u1ee9 ho\u1ea1t \u0111\u1ed9ng tr\u01a1n tru. N\u1ebfu v\u1ea5n \u0111\u1ec1 v\u1eabn ti\u1ebfp di\u1ec5n, h\u00e3y c\u00e2n nh\u1eafc vi\u1ec7c li\u00ean h\u1ec7 v\u1edbi nh\u00e0 cung c\u1ea5p d\u1ecbch v\u1ee5 l\u01b0u tr\u1eef ho\u1eb7c t\u00ecm ki\u1ebfm s\u1ef1 h\u1ed7 tr\u1ee3 t\u1eeb c\u1ed9ng \u0111\u1ed3ng WordPress.<\/p>\n\n\n\n<h2 id=\"Nh\u1eefng_c\u00e2u_h\u1ecfi_th\u01b0\u1eddng_g\u1eb7p\"><a id=\"post-121197-_mx3jv87vdlqz\"><\/a>Nh\u1eefng c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/h2>\n\n\n\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"L\u1ed7i_n\u00e0y_c\u00f3_x\u1ea3y_ra_n\u1ebfu_website_b\u1ecb_t\u1ea5n_c\u00f4ng_kh\u00f4ng?\">L\u1ed7i n\u00e0y c\u00f3 x\u1ea3y ra n\u1ebfu website b\u1ecb t\u1ea5n c\u00f4ng kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>C\u00f3. M\u1ed9t s\u1ed1 cu\u1ed9c t\u1ea5n c\u00f4ng (nh\u01b0 DDoS, c\u00e0i m\u00e3 \u0111\u1ed9c) c\u00f3 th\u1ec3 l\u00e0m gi\u00e1n \u0111o\u1ea1n k\u1ebft n\u1ed1i c\u01a1 s\u1edf d\u1eef li\u1ec7u ho\u1eb7c thay \u0111\u1ed5i th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1eadp tin c\u1ea5u h\u00ecnh. B\u1ea1n n\u00ean:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ki\u1ec3m tra v\u00e0 kh\u00f4i ph\u1ee5c th\u00f4ng tin wp-config.php n\u1ebfu b\u1ecb thay \u0111\u1ed5i.<\/li>\n\n\n\n<li>Qu\u00e9t m\u00e3 \u0111\u1ed9c b\u1eb1ng c\u00e1c plugin b\u1ea3o m\u1eadt nh\u01b0 Wordfence.<\/li>\n<\/ul>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"C\u00f3_c\u00e1ch_n\u00e0o_tr\u00e1nh_l\u1ed7i_n\u00e0y_trong_t\u01b0\u01a1ng_lai_kh\u00f4ng?\">C\u00f3 c\u00e1ch n\u00e0o tr\u00e1nh l\u1ed7i n\u00e0y trong t\u01b0\u01a1ng lai kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<ul class=\"wp-block-list\">\n<li>Sao l\u01b0u \u0111\u1ecbnh k\u1ef3 c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1eadp tin website.<\/li>\n\n\n\n<li>S\u1eed d\u1ee5ng hosting ch\u1ea5t l\u01b0\u1ee3ng cao, \u1ed5n \u0111\u1ecbnh.<\/li>\n\n\n\n<li>H\u1ea1n ch\u1ebf xung \u0111\u1ed9t plugin\/theme b\u1eb1ng c\u00e1ch ki\u1ec3m tra k\u1ef9 tr\u01b0\u1edbc khi c\u00e0i \u0111\u1eb7t.<\/li>\n\n\n\n<li>\u0110\u1ea3m b\u1ea3o t\u00e0i nguy\u00ean m\u00e1y ch\u1ee7 \u0111\u1ee7 m\u1ea1nh n\u1ebfu website c\u00f3 l\u01b0\u1ee3ng truy c\u1eadp l\u1edbn.<\/li>\n<\/ul>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"L\u1ed7i_n\u00e0y_c\u00f3_th\u1ec3_do_h\u1ebft_t\u00e0i_nguy\u00ean_m\u00e1y_ch\u1ee7_kh\u00f4ng?\">L\u1ed7i n\u00e0y c\u00f3 th\u1ec3 do h\u1ebft t\u00e0i nguy\u00ean m\u00e1y ch\u1ee7 kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>C\u00f3. Tr\u00ean c\u00e1c share hosting, n\u1ebfu t\u00e0i nguy\u00ean nh\u01b0 RAM, CPU ho\u1eb7c b\u0103ng th\u00f4ng b\u1ecb v\u01b0\u1ee3t gi\u1edbi h\u1ea1n, m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u s\u1ebd kh\u00f4ng th\u1ec3 x\u1eed l\u00fd y\u00eau c\u1ea7u. Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, b\u1ea1n c\u1ea7n:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>N\u00e2ng c\u1ea5p l\u00ean g\u00f3i hosting cao h\u01a1n n\u1ebfu c\u1ea7n thi\u1ebft.<\/li>\n\n\n\n<li>Ki\u1ec3m tra gi\u1edbi h\u1ea1n t\u00e0i nguy\u00ean c\u1ee7a hosting.<\/li>\n<\/ul>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"_T\u00f4i_c\u1ea7n_li\u00ean_h\u1ec7_ai_n\u1ebfu_kh\u00f4ng_th\u1ec3_t\u1ef1_kh\u1eafc_ph\u1ee5c_l\u1ed7i_n\u00e0y?\"> T\u00f4i c\u1ea7n li\u00ean h\u1ec7 ai n\u1ebfu kh\u00f4ng th\u1ec3 t\u1ef1 kh\u1eafc ph\u1ee5c l\u1ed7i n\u00e0y?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>N\u1ebfu b\u1ea1n \u0111\u00e3 th\u1eed m\u1ecdi c\u00e1ch m\u00e0 v\u1eabn kh\u00f4ng s\u1eeda \u0111\u01b0\u1ee3c l\u1ed7i, h\u00e3y li\u00ean h\u1ec7 v\u1edbi \u0111\u1ed9i ng\u0169 h\u1ed7 tr\u1ee3 c\u1ee7a nh\u00e0 cung c\u1ea5p hosting ho\u1eb7c chuy\u00ean gia qu\u1ea3n tr\u1ecb website \u0111\u1ec3 \u0111\u01b0\u1ee3c tr\u1ee3 gi\u00fap.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\n<script type=\"application\/ld+json\">\n\t{\n\t\t\"@context\": \"https:\/\/schema.org\",\n\t\t\"@type\": \"FAQPage\",\n\t\t\"mainEntity\": [\n\t\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"L\u1ed7i n\u00e0y c\u00f3 x\u1ea3y ra n\u1ebfu website b\u1ecb t\u1ea5n c\u00f4ng kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>C\u00f3. M\u1ed9t s\u1ed1 cu\u1ed9c t\u1ea5n c\u00f4ng (nh\u01b0 DDoS, c\u00e0i m\u00e3 \u0111\u1ed9c) c\u00f3 th\u1ec3 l\u00e0m gi\u00e1n \u0111o\u1ea1n k\u1ebft n\u1ed1i c\u01a1 s\u1edf d\u1eef li\u1ec7u ho\u1eb7c thay \u0111\u1ed5i th\u00f4ng tin k\u1ebft n\u1ed1i trong t\u1eadp tin c\u1ea5u h\u00ecnh. B\u1ea1n n\u00ean:<\/p><ul><li>Ki\u1ec3m tra v\u00e0 kh\u00f4i ph\u1ee5c th\u00f4ng tin wp-config.php n\u1ebfu b\u1ecb thay \u0111\u1ed5i.<\/li><li>Qu\u00e9t m\u00e3 \u0111\u1ed9c b\u1eb1ng c\u00e1c plugin b\u1ea3o m\u1eadt nh\u01b0 Wordfence.<\/li><\/ul>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"C\u00f3 c\u00e1ch n\u00e0o tr\u00e1nh l\u1ed7i n\u00e0y trong t\u01b0\u01a1ng lai kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<ul><li>Sao l\u01b0u \u0111\u1ecbnh k\u1ef3 c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 t\u1eadp tin website.<\/li><li>S\u1eed d\u1ee5ng hosting ch\u1ea5t l\u01b0\u1ee3ng cao, \u1ed5n \u0111\u1ecbnh.<\/li><li>H\u1ea1n ch\u1ebf xung \u0111\u1ed9t plugin\/theme b\u1eb1ng c\u00e1ch ki\u1ec3m tra k\u1ef9 tr\u01b0\u1edbc khi c\u00e0i \u0111\u1eb7t.<\/li><li>\u0110\u1ea3m b\u1ea3o t\u00e0i nguy\u00ean m\u00e1y ch\u1ee7 \u0111\u1ee7 m\u1ea1nh n\u1ebfu website c\u00f3 l\u01b0\u1ee3ng truy c\u1eadp l\u1edbn.<\/li><\/ul>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"L\u1ed7i n\u00e0y c\u00f3 th\u1ec3 do h\u1ebft t\u00e0i nguy\u00ean m\u00e1y ch\u1ee7 kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>C\u00f3. Tr\u00ean c\u00e1c share hosting, n\u1ebfu t\u00e0i nguy\u00ean nh\u01b0 RAM, CPU ho\u1eb7c b\u0103ng th\u00f4ng b\u1ecb v\u01b0\u1ee3t gi\u1edbi h\u1ea1n, m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u s\u1ebd kh\u00f4ng th\u1ec3 x\u1eed l\u00fd y\u00eau c\u1ea7u. Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, b\u1ea1n c\u1ea7n:<\/p><ul><li>N\u00e2ng c\u1ea5p l\u00ean g\u00f3i hosting cao h\u01a1n n\u1ebfu c\u1ea7n thi\u1ebft.<\/li><li>Ki\u1ec3m tra gi\u1edbi h\u1ea1n t\u00e0i nguy\u00ean c\u1ee7a hosting.<\/li><\/ul>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \" T\u00f4i c\u1ea7n li\u00ean h\u1ec7 ai n\u1ebfu kh\u00f4ng th\u1ec3 t\u1ef1 kh\u1eafc ph\u1ee5c l\u1ed7i n\u00e0y?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>N\u1ebfu b\u1ea1n \u0111\u00e3 th\u1eed m\u1ecdi c\u00e1ch m\u00e0 v\u1eabn kh\u00f4ng s\u1eeda \u0111\u01b0\u1ee3c l\u1ed7i, h\u00e3y li\u00ean h\u1ec7 v\u1edbi \u0111\u1ed9i ng\u0169 h\u1ed7 tr\u1ee3 c\u1ee7a nh\u00e0 cung c\u1ea5p hosting ho\u1eb7c chuy\u00ean gia qu\u1ea3n tr\u1ecb website \u0111\u1ec3 \u0111\u01b0\u1ee3c tr\u1ee3 gi\u00fap.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t]\n\t}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Trong qu\u00e1 tr\u00ecnh s\u1eed d\u1ee5ng WordPress, kh\u00f4ng \u00edt ng\u01b0\u1eddi d\u00f9ng \u0111\u00e3 g\u1eb7p ph\u1ea3i l\u1ed7i &#8220;Error Establishing A Database Connection&#8221;. \u0110\u00e2y l\u00e0 m\u1ed9t trong nh\u1eefng v\u1ea5n \u0111\u1ec1 ph\u1ed5 bi\u1ebfn v\u00e0 g\u00e2y kh\u00f3 ch\u1ecbu nh\u1ea5t \u0111\u1ed1i v\u1edbi c\u00e1c qu\u1ea3n tr\u1ecb vi\u00ean website. Khi l\u1ed7i n\u00e0y x\u1ea3y ra, trang web c\u1ee7a b\u1ea1n s\u1ebd kh\u00f4ng th\u1ec3 truy c\u1eadp \u0111\u01b0\u1ee3c, [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":121205,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7382],"tags":[7400],"class_list":["post-121197","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sua-loi-wordpress","tag-sua-loi-wordpress"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/121197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=121197"}],"version-history":[{"count":4,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/121197\/revisions"}],"predecessor-version":[{"id":122112,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/121197\/revisions\/122112"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/121205"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=121197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/categories?post=121197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=121197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}