[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

Note: http://www.west.cn/faq/list.asp?unid=722 Please run the script in this tutorial first. If it cannot be restored, troubleshoot according to the following steps.

I. Accessing the wdcp system prompts that it cannot connect to mysql

1. The mysql service may not be started. First, log in to the server via ssh, then run service mysqld restart to restart mysql and try accessing again. For the ssh remote login method: http://www.west.cn/faq/list.asp?unid=417If it cannot be started, 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 the restart, and if there is no data or it was newly purchased, you can reinstall it in the backend. If there is data, please mount it yourself, or select in the backend Reset disk partitions (merge extra disks into D drive), Linux remount partitions, etc. and submit a ticket for our company to check and handle it. If there is a startup error, please select Troubleshooting issues such as mssql/mysql database failing to start and submit.

2. After restarting mysql, it still prompts that it cannot connect to mysql

① Add phpmyadmin after the wdcp access address to directly manage mysql online, such as http://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 be used to log in, please try root3306. If this password also cannot log in, please reset it according to http://www.west.cn/faq/list.asp?unid=571 and then log in.

② After logging in, click sql, enter the following sql statement 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, run vi /home/wddata/data/db.inc.php, press the letter a to enter edit mode, find the $dbpw field, replace the password inside the double quotes with the password modified just now, then press ESC to exit editing, then press shift+: (colon), enter wq and press Enter to exit. This will fix the problem that wdcp cannot connect to mysql.

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

Enter the online mysql management mode according to the above method, then execute the following sql command. Similarly, replace xxx with the initial password:

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

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

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