Database Error In Forum


#1

I was trying to add a MOD (from phpbbhacks.com) to allow me to add links to other pages on the forum. It told me to add a value to the phpbb_config part of my database. So I signed into my database at http://forum.wiscollectorcar.com, went to phpbb_config, selected Browse, and then “Insert New Row” at the bottom. I then looked at it and I couldn’t make sense of what I was supposed to add so I decided to just forget it so I hit the back button and closed the window. I then tried going to my forum, www.wiscollectorcar.com/forum/ but it gives a Critcal Error, cannot connect to database. Now because it says cannot connect I’m guessing that this problem isn’t because of a modifcation that I made, its just that it canno tconnect. I tried logging out of hte database and waiting a good 15 minutes before trying again but nothing changed. I do have a backup of the full database (minus the posts in the last few days) which does include the phpbb_config section but I don’t know how to upload it because normally I would do it in the forum.
Any ideas or help would be much appreciated!
Thanks,
Garibaldi


#2

I would give it a bit more time. There have been a few posts here recently about db connection errors. So restoring the database would be a bad idea.

Depending on the size of the backup file, you might be able to use phpmyadmin. Just login to it, and select SQL.

Or login to SSH, navigate to the folder your backup file is in (upload it to your server if not) and type

mysql -h dbhost.domain.com -u user -p db_to_use > backup.sql

I’ll check but I think you use > and not <


#3

Ok, as of 7:30 AM Central Time today its still not working. I would really prefer not to do a restore of my db from a backup unless its absolutely necessary because I will loose several days of posts. The thing that seems strange to me is that the other two databases on my site work fine:
Coppermine Photo Gallery:
http://www.wiscollectorcar.com/coppermine/cpg132
PHPFN (News):
http://www.wiscollectorcar.com


#4

DO NOT:
[color=#CC0000]mysql -h dbhost.domain.com -u user -p db_to_use > backup.sql[/color]
(I wish Strikethrough worked here)

It will Overwrite your backupfile.

you want mysql -h dbhost.domain.com -u user -p db_to_use < backup.sql

[quote]- Says Send output to.
[/quote]

< - Says get input from

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#5

Thanks for that. I’ll edit my previous post. I knew it was one of them (only two choices?!) and I got the wrong one ^_^;;

EDIT: It’s not letting me edit my previous post :expressionless:


#6

Ok, I haven’t entered any commands like that yet or anything. What I would like to do is restore the backup db that I have. I have also made a backup of the current db just in case. Now I am using myphpbbAdmin, and I don’t see where I can enter commands like that, how do I do that? Also if I put that backup.sql file somewhere on my site like say www.wiscollectorcar.com/backup.sql, do I just say that instead of backup.sql? Basically what is the root dir there?


#7

Those commands are entered from the Shell. In my experience phpMyAdmin is not suitable for doing a full backup and restore.

-Jason

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#8

So how do I edit them in the shell? should I just boot up linux, open a new bash prompt, and enter that line?


#9

Ok, I haven’t entered any commands like that yet or anything. What I would like to do is restore the backup db that I have. I have also made a backup of the current db just in case. Now I am using myphpbbAdmin, and I don’t see where I can enter commands like that, how do I do that? Also if I put that backup.sql file somewhere on my site like say www.wiscollectorcar.com/backup.sql, do I just say that instead of backup.sql? Basically what is the root dir there?

I cannot get access to my site using that script. it keeps giving me this error:
ERROR 1045: Access denied for user: ‘wiscolle@mdsnwi13-vlan434-218.dsl.tds.net’ (Using password: YES)
when I try and use the same user, wiscolle, with myphpbbadmin


#10

[quote]Those commands are entered from the Shell. In my experience phpMyAdmin
is not suitable for doing a full backup and restore.

[/quote]

Agreed. phpMyAdmin is usually fine for backing up small databases or, more often, structure. However, PHP timeouts make it pretty poor for anything much larger than that.

  • Jeff @ DreamHost
  • DH Discussion Forum Admin

#11

Read This Wiki article and see if it helps.
Migrate MySQL

And see if it helps.

-Jason

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#12

I use MySQL Administrator to do backups of my forum (it can be used for anything). It allows for a set of backup preferences so I can have several different sets. If I want to back up just certain tables or the whole thing.

I added a *(wild card)@mylocalpop to the database so I can just connected directly to the database.

MySQL Administrator runs great on OS X not sure about Windows.

happylittlethings.com


#13

I’ve restored the database from my backup. Now I have both the good and bad sql files. Unfortunately because I restored I lost over 200 posts. Could someone with some sql experience take a look at the 2 files and possibly correct what is wrong with the bad one or just add the new posts to the good one? Here are the two files:
http://www.wiscollectorcar.com/downloads/good.sql
http://www.wiscollectorcar.com/downloads/bad.sql


#14

I’m looking at it now. But thats a pretty significant thing your asking…

-Jason

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#15

I have it working.

http://mysticserver.com/better.sql

Email me Jason i40.com when you have it so I can remove the file.

What I did. Converted the DOS file into a Unix file (CR/LF) and took out the use “car_collector” database statements. I tested by doing a
mysql -hhostname -uusername -ppassword newdb < better.sql
from telnet. It loaded with no errors, and the tables appeared to be all there.

you will need to start with an EMPTY table.

-Jason

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#16

On the bad database could you just make indivudual backups of “phpbb_posts” and “phpbb_posts_text” and import them into the good database file. The only thing that might not be fixed is post count. If that were me I would just create a test database and try that. See if it works :slight_smile:

Edit: looks like jrahaim has it :smiley:

happylittlethings.com


#17

I did the whole file, since I didn’t want to figure out which Tables constituted a post.

-Jason

I40.com - Home Page
MP3Mystic - Personal Streaming Music server.
(Neither of these sites are still hosted at dreamhost)


#18

Thank you Jason for all your hard work!! I’ve been working on something similar to what you’ve been doing, I’ve had someone upload the “bad” file to another site and amazingly it worked fine! I was then able to upload it to my site and now it works! Thank you for modifying my sql, I think that is a good idea for me to keep as a backup file incase this would ever happen again.