MySQL dbs all disappeared!

Status
Not open for further replies.

ajmarini

New Member
Messages
4
Reaction score
0
Points
1
Both of my DBs (named anthony4_varaus and anthony4_wp225) have completely disappeared, although the names and users attached to them still show up in the cPanel database display. The error message from a database check is
Error from MySQL query: DBD::mysql::db do failed: Unknown database 'anthony4_varaus' at /usr/local/cpanel/Cpanel/Mysql.pm line 1196. Failed to use anthony4_varaus: Unknown database 'anthony4_varaus'

I know that there was a migration recently. I imagine that backups were made before the migration, so is it possible to restore these DBs from the backup?

Thank you!
 

ijsotelx

New Member
Messages
3
Reaction score
0
Points
1
I am having the same issues when I try to go to my site. It says "database connection failed". Then when I do a database check in c-panel, it says the following:

Error from MySQL query: DBD::mysql::db do failed: Unknown database 'ijsotelx_ojs' at /usr/local/cpanel/Cpanel/Mysql.pm line 1196. Failed to use ijsotelx_ojs: Unknown database 'ijsotelx_ojs'

How can we get this resolved? My site is completely down.

Thanks!
 

ijsotelx

New Member
Messages
3
Reaction score
0
Points
1
AJ

I got my site working again. I noticed in the c-panel under the mysql, that x10 copied my database but left off a letter at the end (instead of ijsotelx_ojs they had ijsotelx_oj).
So, first I added myself as a user to the new but inaccurate database ijsotelx_oj (this will be important for the last step). Next, I looked in the web root of the server using the file browser and downloaded the text file at the bottom of the list that is a generic file type. It will be labeled the name of your mysql database followed by a bunch of numbers. This is the database backup for your site. If you "edit" the file you will see in the file itself that it says mysql dump, which lets you know it is a backup. The file was dated 4/27; so I think this is when they did their migration. OK, so download your database backup file to your computer. Next, go back to c-panel and click on phpmyadmin application. It will take a while to load. On the left you will see a list of your current databases. In my case only the new incorrect database was listed. Click on the database (mine was ijsotelx_oj) and then click on the "sql" tab to the right. On that tab click on "import". Then simply click on the file browser and select your downloaded database backup file. Finally click on "go". That is it. You should see a long list of tables on the left under your database name now. The last step is to go back to the file manager app in c-panel and look for your Wordpress config file. It is usually in the root of the website and called wp_config.php or something similar. Click on the file and then the "edit" button at the top to change the settings. Then go down to where you enter the database name for the site (you can do ctrl F to search within the text file and search for your old database name). Change the database from the old one to the new one. In my case I changed "ijsotlx_ojs" to "ijsotelx_oj). If you did not add yourself as a user to the new database (my first step), then go back and do so. Otherwise it will not work. Click save changes. Refresh your website, and it should be back! I hope this is helpful and works for you.
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
@ajmarini

I've restored your databases.. is all the data there?
 
Status
Not open for further replies.
Top