Error establishing a database connection!
生活随笔
收集整理的這篇文章主要介紹了
Error establishing a database connection!
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
后來發現在 wp-config.php?有個 debug?的參數,打開這個參數,修改為:
define('WP_DEBUG','true');修改這個后,非常不錯,報了很多錯,一堆。。。。
使用修復的命令來修復。
mysql>repair table wp_options;搞定,然后關掉 DEBUG,解決問題。
以下是我的解決方法:1.到phpMyAdmin新增一個使用者
假設帳號:test
? ? ? ?密碼:test123
2.給予您Wordpress資料庫控制的權限
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設置 - 具體信息來自您正在使用的主機 ** //
/** WordPress數據庫的名稱,替換掉 “putyourdbnamehere” */
define('DB_NAME', 'xxxx');
/** MySQL數據庫用戶名,替換掉 “usernamehere” */
define('DB_USER', 'xxxxx');
/** MySQL數據庫密碼,替換掉 “yourpasswordhere” */
define('DB_PASSWORD', 'xxxxxxx');
/** MySQL主機名 */
define('DB_HOST', 'localhost'); 重新整理Wordpress即可解決!! ? ?
轉載于:https://www.cnblogs.com/the-king-of-cnblogs/p/3160617.html
總結
以上是生活随笔為你收集整理的Error establishing a database connection!的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎样为ubuntu eclipse 添加
- 下一篇: c# dataGridView 设置