Page 1 of 2

Re: MySqlDatabase Problem!

Posted: 28 Jan 2012, 22:32
by Stitch Up
Long story short!

I downloaded and installed FileZilla FTP client today with the intention of trying to cleanup the remnants of my hacked site www.stitch-up.biz

I did a VERY STUPID THING! Thinking I could simply delete the whole file structure and start again - I did just that!!! Consequently I lost my email accounts for stitch-up.biz and all the other sub-domains. Some of the sub-domains are those of my family and the phone soon started ringing! By now, I realised how stupid I'd been!

Anyway, i searched for the last backup I'd made and found one from August 2010. As I haven't added any sub-domains since then, I tried to upload via ftp to the root of my stitch-up.biz domain. Remarkably it worked & I got all my email accounts back - PHEW!

So I decided to try and access my website www.stitch-up.biz but get the following error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for
user 'stitchu1_stitch'@'localhost' (using password: YES) in
/home/stitchu1/public_html/includes/functions/database.php on line
19
Unable to connect to database server!

I'm likely to have changed the password since my site was hacked and after the backup now restored. Is this the reason for the error?

I looked at line 19 in database.php and there were references to $username & $password. Should I edit this line or are these variables picked up elsewhere?

Not really knowing what I'm talking about - can anyone shed some light on the matter?

Cheers

John

Re: MySqlDatabase Problem!

Posted: 28 Jan 2012, 22:51
by Paul
i dont know much about it but i know in many cases password is coded so it can not be just changed in data base... if you can log in to mysql admin and back your data base up. remove all and set one up again with this same database name and password. then just upload your back up again. all tables excluding one with password. i did that ones with my online shop when forgot password to shop admin. worked tread and not to difficult to do. hope you know what i am on about ;)

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 00:05
by cardman
when u set your database up - you made a mysql database that your shop connects to.
So to make the database u used a name for the database and gave it a username and password
well u should have another file called config.php or something like that
check that the username and password for your mysql database (the one u connecting to) are the same

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 08:34
by smitch6
stitch up just speak to your host if you are on shared hosting they should of ben keeping regular backups weekly
and they will also be able to retrieve all lost info etc from their server panel
it's hard but it's possible or if not they can over-write them for you

when you re-installed everything did you re-do the database?
you may not of put it back ;)
it's an easy mistake to forget the database :)

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 10:49
by Stitch Up
Thanks for the replies guys.

My immediate concern, the loss of email accounts has been resolved. I had to recreate 1 email account as it was added AFTEr the last backup in 2010.

smitch - I haven't reinstalled the sql database as I didn't think I'd deleted it! I didn't know it resided in the file structure that I DID DELETE!!! Does it?

When I go to the hosts control panel and my account/My SQL Databases one database is listed but it's size is 0.00Mb! What would you suggest? If I create a new sql database do I have to give it a specific name? The error doesn't give me any clues in that direction!

I need to learn a bit more before I dabble :)

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 11:00
by smitch6
if it has gone then you can either speak to your host who should have a back up of it
or create a new one exactly the same name and pass as you had before
and hopefully it should work

but honestly your host should keep regular back ups of everything on the server for you
altho this only happens with shared hosting if it's your server then it's up to you to keep regular back=ups

i pay extra to my host and they do it all for me :) because you never know when someone will delete something by mistake ;)

a quick chat with them and everything should be sorted hopefully

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 11:22
by Stitch Up
Thanks smitch. As I had nothing to lose, I deleted the SQL database that was listed with 0.00Mb and recreated using the MySQL Database Wizard - all pretty easy really! However, it still shows the database as 0.00Mb so I'm guessing this is how it is.

Probably need to discover what the password was when my site was hacked as I changed it afterwards.

I have sent an support ticket to my hosting service and just waiting their reply.

Cheers

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 14:27
by smitch6
kool keep me/us updated pls :)

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 16:28
by JSR
As smitch says, your host should have a backup - although some charge more for this (because they don't want to automatically backup everyone's account that's on the server, as they've probably oversold it in the first place). They should be able to reinstall from the last backup they have with no hassle whatsoever.

I do my own GFS backups on my servers, and keep copies locally from time to time, but that's just me.

I'm curious, though, how deleting files in your hosting space would delete your MySQL files. That's not where they are on my server.

Re: MySqlDatabase Problem!

Posted: 29 Jan 2012, 21:40
by cardman
from looking at his post above it looks like his board is not actually connecting to the database so maybe username/pass or even correct name of database is not entered correctly.
When i ran a board like this one - used to have a file called config.php which contained that info
Once that info was entered you just renamed config.php or removed it from server for secuirty reasons.