Error establishing a database connection!

errot1.jpg

后来发现在 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即可解決!!
errot1.jpg
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值