Applicable to:
- Plesk for Linux
Symptoms
- Databases disappeared from the subscription
example.com
( Subscriptions > example.com > Databases). - Physically databases exist on MySQL server and can be accessed via PHPmyAdmin.
Cause
Absent records in Plesk database in data_bases
and db_users
tables.
Resolution
If databases were present earlier, absent records can be retrieved from Plesk database daily dumps:
-
Connect to the server via SSH and create Plesk database dump:
# plesk db dump psa > /root/psa.dump.`date +%Y%m%d.%H%M`
-
Check Plesk database dumps located in
/var/lib/psa/dumps/mysql.daily.dump.*
for records regarding missing database (e.g,wordpress_db
). For searching use the database name:# zgrep wordpress_db /var/lib/psa/dumps/mysql.daily.dump.0.gz
...(2,'wordpress_db','mysql',7,3,NULL)... -
Insert the above record in
data_base
table:# plesk db
mysql> INSERT INTO data_bases VALUES (2,'wordpress_db','mysql',7,3,NULL); -
Find missing entry for
db_users
table using the same approach and searching bu database user where db_id is equal to the id from the previous step (2, in this example) and insert it:# zgrep wordpress_user /var/lib/psa/dumps/mysql.daily.dump.0.gz
...(8,'wordpress_user',4,2,'normal',12,1,'',NULL,'readWrite')...
# plesk db
mysql> INSERT INTOdb_users
VALUES (8,'wordpress_user',4,2,'normal',12,1,'',NULL,'readWrite');
Comments
2 comments
The plesk db dump command has wrong syntax, probably got lost in formatting (when using ` backticks)
You can also use: plesk db dump psa > /root/psa.dump.$(date +%Y%m%d.%H%M)
Hello @Stéphan,
Thank you for notice.
The article has been fixed.
Please sign in to leave a comment.