Big problems!! database/sql issues

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
JulieJesta
Registered User
Posts: 116
Joined: Mon Oct 16, 2006 8:39 am
Location: England
Contact:

Big problems!! database/sql issues

Post by JulieJesta »

my sites database vanished. the backups i had are not working. only back up i could get to work is from last year. SITE itself still correct... but wrong sql. i really need help please.

i cant access my ACP in the phpbb. therefore i cant get to easy mod to do "auto cookies"

erm, very out of my depth... ask me questions, i'll try to answer. dunno what i need to tell you to fix this?
Julie, Mum to 1 boy, 1 boyfriend, and many fluffy pets. :)
http://www.parentstime.co.uk
User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: Big problems!! database/sql issues

Post by Jim_UK »

Hi Julie
Databases do not just vanish. There must be a reason for this. Did you accidentally drop the tables maybe?

If you do not have a database backup then you should ask your host to see if they have a recent one.

If you do not and they do not then I am afraid that you are stuck with the last one that you made.

Running the auto cookie mod will not bring back your database and nor do you need Easymod to run the auto cookie mod.
It is simple ftp'd to the root of phpBB2 and run with your browser.

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!
JulieJesta
Registered User
Posts: 116
Joined: Mon Oct 16, 2006 8:39 am
Location: England
Contact:

Re: Big problems!! database/sql issues

Post by JulieJesta »

jim, Firstly, thanks!
Hosts say we were hacked. does injection attack mean anything? Our database was passworded ect. i am the only one with direct mysqladmin access. makes little sense.. but it kept losing tables. first time was 3 tables left, this time was down to 6 tables. hosts have apparently tried to find me a backup that had the 35+ tables but said there isnt one. i'm not sure if i believe this. nor do i understand how a secure item like a database can be accessed by a non password holder?

i've put on a very out of date db backup. october of last year. and i've manually added a few tables that needed for mods i added after october. looking in the mods files to find the [SQL] tag bits.
i think there must be a table that relates to the acp? nothing there suggests admin, acp or anything like that?

i had a db backup from march this year... but the sql file loads in phpmyadmin then says "no data found" which is wrong. if i open i notepad... its rammed with data?? if i could be told how to take just the posts, pm's and memberlist info, i could start a new vanilla phpbb install and upload this info on new blank db that goes with it?

how can i prevent this in future?
Julie, Mum to 1 boy, 1 boyfriend, and many fluffy pets. :)
http://www.parentstime.co.uk
User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: Big problems!! database/sql issues

Post by Jim_UK »

Firstly if you have a database backup that will not restore then it is probably due to its size. Over about 2MB then we have to resort to either splitting the file or using something like Bigdump

Re the ACP - Have you checked to see that the admin directory is present in the root of your install and that there is an admin directory in the templates/yourstyle directory

You have not said what version you are using but the best way of staying safe is to always be on the current one (now 2.0.22) and to make sure that all mods installed are up to date. Further you should be sure that any other applications you have installed on the server are also up to date.

Even then it could be that the hosts server software may not be up to date. There was a recent exploit of cpanel for example.

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!
JulieJesta
Registered User
Posts: 116
Joined: Mon Oct 16, 2006 8:39 am
Location: England
Contact:

Re: Big problems!! database/sql issues

Post by JulieJesta »

hiya,
it wasnt most recent version. there is so much wrong with site at present i think go for a new vanilla of the latest version (non beta) then reinstall a few basic mods. most of the info on the databse is irreavant tbh.
all i *need* is the member info and messages/topics from the last database backup?? but how do i take just that info from the .sql file? when i open it its massively long lines of text, that seem to make little sence. is there a phrase i can use "find next" for to locate these tables? if i then run them as queries on the new fresh database.... will that work?
Julie, Mum to 1 boy, 1 boyfriend, and many fluffy pets. :)
http://www.parentstime.co.uk
User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: Big problems!! database/sql issues

Post by Jim_UK »

It is not just as simple as taking a section of the database. A lot of the tables are tied in together.
Best way is to make a backup of all your forum files and your database. Be sure to make a copy of config.php.
Now rename your forum folder from phpBB2 or whatever it is called to something like "backup"
Now ftp the complete new phpBB2.0.22 directory to the root of your webspace.
Now rename it to what your old one was.
Now replace your old config.php to overwrite the blank in the new files.
Now run the file install/update_to_latest.php with your browser.
Now delete the install and contrib directories.
You can then add any styles you might want and any mods you want.
Don't worry about the mod related tables that are in the database. phpBB2 does not care about them being there so why should you. :D

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Big problems!! database/sql issues

Post by asinshesq »

I think you should try harder to restore that recent backup you have, and that will likely require you to divide the .sql file you have into smaller parts that will be able to properly run.

Open the .sql in a text editor so you can see what is going on, and copy the part from the beginning of the file to just before the first line that mentions phpbb_post_text and paste that into it's own new file with a .sql ending. Then run that file using phpmyadmin and see if that restores properly.

Next, copy the next part of the file from the first line that mentions phpbb_post_text to just before the first line that mentions phpbb_privmsgs, paste that into ints own .sql file and run that with phpmyadmin.

Next, do the same thing from the first line that mentions phpbb_privmsgs to just before the first line that mentions phpbb_search_wordmatch.

Finally, do the same thing for teh first line that mentions phpbb_search_wordmatch to the end.

if any sql won't run in phpmyadmin, you can further split it up.

Once you have it all restored, you can easily upgrade to phpbb2.0.22 but frankly getting the db up and running is the hard part.
JulieJesta
Registered User
Posts: 116
Joined: Mon Oct 16, 2006 8:39 am
Location: England
Contact:

Re: Big problems!! database/sql issues

Post by JulieJesta »

Alan,
Would you possibly be willing to help me with this please? i've spent 3 hours trying, but mysql returns errors and i dunno what to do. everything i try say duplicate entry, then wont load any of the other info.... or more annoyingly says "you didnt upload any data!"
Julie, Mum to 1 boy, 1 boyfriend, and many fluffy pets. :)
http://www.parentstime.co.uk
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Big problems!! database/sql issues

Post by asinshesq »

Sorry, I don't have time to get into the middle of something like that. You should have your host helping you at this point.

But duplicates? Does your sql say to drop tables if exist? If not, the problem is that you need to start with a db that has no tables.

If it does, it sounds like you are overlapping some of the pieces. Each little sql file should have only its own parts. If you have some of the same lines on more than one of the sql files, the second time you run you are duplicating what the first one did.
Locked

Return to “2.0.x Support Forum”