Error establishing a database connection!
生活随笔
收集整理的這篇文章主要介紹了
Error establishing a database connection!
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
后來發(fā)現(xiàn)在 wp-config.php?有個(gè) debug?的參數(shù),打開這個(gè)參數(shù),修改為:
define('WP_DEBUG','true');修改這個(gè)后,非常不錯(cuò),報(bào)了很多錯(cuò),一堆。。。。
使用修復(fù)的命令來修復(fù)。
mysql>repair table wp_options;搞定,然后關(guān)掉 DEBUG,解決問題。
以下是我的解決方法:1.到phpMyAdmin新增一個(gè)使用者
假設(shè)帳號(hào):test
? ? ? ?密碼:test123
2.給予您Wordpress資料庫控制的權(quán)限
3.修改wordpress/wp-config.php檔案
vim wp-config.php
找到
// ** MySQL settings ** //?
define(‘DB_NAME’, ‘wordpress_db’); ? ?// The name of the database?
define(‘DB_USER’, ‘old_name’); ? ? // Your MySQL username?
define(‘DB_PASSWORD’, ‘old_passwd’); // …and password
修改為
// ** MySQL settings ** //?
define(‘DB_NAME’, ‘wordpress_db’); ? ?// The name of the database?
define(‘DB_USER’, ‘test’); ? ? // Your MySQL username?
define(‘DB_PASSWORD’, ‘test123′); // …and password
//把新的使用者換上即可 // ** MySQL設(shè)置 - 具體信息來自您正在使用的主機(jī) ** //
/** WordPress數(shù)據(jù)庫的名稱,替換掉 “putyourdbnamehere” */
define('DB_NAME', 'xxxx');
/** MySQL數(shù)據(jù)庫用戶名,替換掉 “usernamehere” */
define('DB_USER', 'xxxxx');
/** MySQL數(shù)據(jù)庫密碼,替換掉 “yourpasswordhere” */
define('DB_PASSWORD', 'xxxxxxx');
/** MySQL主機(jī)名 */
define('DB_HOST', 'localhost'); 重新整理Wordpress即可解決!! ? ?
轉(zhuǎn)載于:https://www.cnblogs.com/the-king-of-cnblogs/p/3160617.html
總結(jié)
以上是生活随笔為你收集整理的Error establishing a database connection!的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎样为ubuntu eclipse 添加
- 下一篇: 第三方控件radupload 使用方式以