[Original] WDCP prompts that it cannot connect to mysql, and when creating a site, it prompts that the mysql password is incorrect.

Published: 2013-05-10

```html

Note: http://www.west.cn/faq/list.asp?unid=722 Please execute the script in that tutorial first. If it cannot be recovered, troubleshoot according to the steps below.

I. Accessing the wdcp system prompts unable to connect to mysql

1. The mysql service may not have started. First log in to the server via ssh, then execute service mysqld restart to restart mysql and try accessing again. For ssh remote login methods:http://www.west.cn/faq/list.asp?unid=417If it cannot start, first use df -lh to check whether the home partition is mounted. If it is not mounted, try restarting first. If it is still not mounted after restart, if there is no data or it is newly purchased, you can reinstall in the backend. If there is data, please mount it yourself, or select in the backend Reset disk partitions (merge excess disks into D drive), linux remount partition, etc. Submit a ticket for our company to check and handle. If there is a startup error, please select Troubleshooting for issues such as mssql/mysql database cannot start and submit.

2. After restarting mysql, it still prompts unable to connect to mysql

① Add phpmyadmin after the wdcp access address to directly manage mysql online, such ashttp://s-53469.gotocdn.com:8080/phpmyadmin Then enter root. The password is the initial password of the backend server (if the root password has been changed, please log in with the changed root password). If the initial password cannot log in, please try root3306. If this password also cannot log in, please reset according tohttp://www.west.cn/faq/list.asp?unid=571 and then log in again.

② After logging in, click sql, enter the following sql statement in it and execute it. Replace xxxxx with the initial password.

use mysql;
update user set password=password("xxxxxx") where user="wdcp";
flush privileges;

Then log in via ssh, vi /home/wddata/data/db.inc.php press the letter a to enter edit mode, find the $dbpw field, replace the password inside "" with the password just modified, then press ESC to exit editing, then press shift+: (colon), enter wq and press Enter to exit. In this way, the problem that wdcp cannot connect to mysql can be fixed.

II. When logging in to create a site or create mysql, it prompts that the root password is incorrect

Follow the above method to enter online mysql management mode, then execute the following sql command. Likewise, replace xxx with the initial password:

use mysql;
update user set password=password("xxxxxx") where user="root";
flush privileges;

Then connect via ssh, vi /home/wddata/data/dbr.inc.php   

$sqlrootpw is the password; replace it with the password just modified. $sqlrootpw_en indicates whether encryption is required; here it needs to be changed to 0. Then save and exit according to the above method.

```