Page 1 of 1

Lost mysql database website recovery

Posted: Sun Jan 17, 2016 2:11 pm
by OliverRichardson
My web server was lost and I am now attempting to get our company website back up and running using the backups we do have. What I do have is all of the files that made up the site but what I do not have a backup of is the mysql config for the site.

Looking through some of the php files I can the database name and the user the pages are calling. What I am unable to find is a database file I could import or any documentation in the source files (that include the original files from the webdevelopers.)

How might I go about finding this information can anyone tell me where to look and secondly how I might go about finding what tables I need to make etc.

Re: Lost mysql database website recovery

Posted: Mon Jan 18, 2016 5:11 am
by KnightRid
I have no personal knowledge nor experience with this but i found this online

http://serverfault.com/questions/82801/ ... t-aptitude

not sure if that will help or not. Hopefully someone will hop on this morning with more knowledge than I.

Re: Lost mysql database website recovery

Posted: Wed Jan 27, 2016 11:11 am
by KristofLakatos
In your old server ..look for the datadir . which is genrally on ubuntu in mycase will be in /var/ ... partition .

You will have all the files there of the databases .

Since you are starting up a new server , my.cnf file should not be a problem since you already have backups .... Just create the databases and redirect from backups .

The my.cnf should be in /etc/mysql/my.cnf path ...

This options file contains all the directives for the data dir location .
See also http://stackoverflow.com/questions/8791 ... -frm-files
http://www.sqlservercentral.com/Forums/ ... 893-1.aspx
Some "gotchas" other people have encountered.
Thanks.

Re: Lost mysql database website recovery

Posted: Wed Jan 27, 2016 11:35 am
by OliverRichardson
Thanks for your response. My old server was IIS and I am unable to get to it all I have are the website files from backup.

My new environment is Ubuntu lamp install. I have the server issuing the page but I get this error when I open the page:

I cannot connect to the database because: Access denied for user 'x'@'localhost' (using password: YES)

At this point I have been scouring all of the .php files and am finding two databases being called including the names and passwords two accounts. From what I can gather one set of creds is for the admin page (backdoor) and the other for the site to call mysql.

I do have the original files from the web developers and would think there would be a sample table I could import or the documentation for what tables to set up but I really don't see anything.

Re: Lost mysql database website recovery

Posted: Wed Jan 27, 2016 2:24 pm
by KristofLakatos
Vaguely i can say that , this is happening because of permissions/credentials for database connectivity ..

Go to shell prompt ..

# issue this command

#mysql -u root -p

Give the password that you have given to mysqlroot ..while installing you should get the msql > like this.
It means you can connect to the database. Later you can check with phpmyadmin also .
If that doesn't help, then I can offer a solution to try to use MySql Recovery Toolbox. I am sure this will increase the chances to recover the data.
http://www.oemailrecovery.com/mysql_recovery.html

Re: Lost mysql database website recovery

Posted: Sun Jan 31, 2016 7:28 am
by OliverRichardson
Thank you all for your advice! The issue has been resolved.