- Plesk Onyx 17.5 for Linux
Note: This article has the reference to the issue with the fix available:
"Removing the database of a cloned website resulted in inability to clone it again to the same domain and with the same database name."
- WordPress Toolkit 2.2.0 19 July 2017
The following error occurs while cloning WordPress instance:
Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordpress_a` database.
When initializing cloning on the same instance again another the following error is observed:
Error while cloning WordPress
Error establishing a database connection. This means that the information on the username and the password in your `wp-config.php` file is not correct, or we can not reach the database server on` localhost`. Your host's database server might be down.
The database with the same name was earlier deleted.
WordPress Toolkit bug EXTWPTOOLK-669 . The bug will be fixed in one of the next Plesk updates.
Until the fix became available, the following steps are required to resolve the issue:
1. Change the name for the database of cloned instance in Plesk interface. The error regarding existing MySQL user will be displayed. For example:
The user wordpress_a already exists.
# plesk db dump mysql > mysql.sql
# plesk db mysql
3. Remove the database user mentioned in the error message:
mysql> delete from user where User="wordpress_a";