News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Uncooperative database or SMF...not sure which.

Started by Mish, April 09, 2007, 07:38:02 PM

Previous topic - Next topic

Mish

I recently upgraded to a reseller account at my host, and am attempting to restore a SMF forum (most recent version) on one of the subdomains of one of the domains that has already propogated.

And I am REALLY trying to avoid a clean install as if I ever have a problem in the future when the forum is much more busy, I don't want to start from scratch.

I tried uploading the backup of the database from the old host; will not connect.

I tried creating a new database with the same name (after deleting the old one of course) and importing the information into the database.

But the error that is not changing is that it is not connecting. I even downloaded repair_settings.php and it tells me: "Some settings are not being shown because the MySQL connection information is incorrect."

When I try to access the forum itself I get this: "Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later."

I am copying/pasting the the username of the database as well as the database name itself to make sure I am not making a typo.

I even went into the PHP files themselves and tried editing the information there as well (again, making sure to use copy and paste).

And I am not trying to use the subdomain address...I am attempting to use the directory address, which will still work once the subdomain starts working anyway.

I also have posted in my webhost's support forum, also waiting to hear from them.  I'm just at loss...any help is appreciated. :)
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

metallica48423

the database connection info in Settings.php appears to be wrong.

i cannot possibly know what this could be or i would help you further, but the advice I can give is contact your host for the values you need.  Likely you will need to create a database and user, and give that user access to the database before it will connect.

Again, ask your host what information you should be using to connect to that database, and then plug that in and hopefully it should work.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

xenovanis

A couple of things you could check:
  • localhost is the default for most hosts, but not always. Could it be you need to connect to a external link instead of localhost?
  • Sometimes hosts add a prefix in front of the databasename and username, for example your accountname. Could that be your problem?
"Insanity: doing the same thing over and over again and expecting different results."

Mish

I have another forum using SMF on the same host (in fact, I just upgraded to the reseller account to manage all my various domains).  The difference is though, is I moved from one service to another...backed up the database onto my computer, then added it to the new host via cPanel.  The old host didn't have cPanel.

So since I have that other forum, I KNOW it's definitely 'localhost' where it wasn't on the old host.

I went into settings.php and settings_bak.php and edited it there first.  That didn't work.

Then I tried re-uploading the database and database username with the same exact stuff I had the first time, and something renamed it (which it didn't do before I upgraded to the reseller).   My host has a forum set up for members; I haven't submitted a support ticket yet but they seem puzzled that stuff is renaming itself, like it's adding it's own prefix.  But I am adding that as well.

I wonder if there is a way to do a clean install and THEN restore the database?  I wonder if that would work better.

I hope I'm making some sort of sense. PHP is not my forte, but I like to think I know code well enough to replace certain things.
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

metallica48423

you can, the settings in Settings.php tell it which database to connect to.  What you plug into install.php tells it what to write to Settings.php and then executes the sql queries to insert the table structure into your board.

One thing about cPanel is that it prepends your cPanel username onto your databases.  For example...

metallica48423_forums

instead of

forums

as the name of the database, so you could try that and see if it'll connect

If not, inquire to your host whether theres any prefixes you need to use on database info
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Mish

I guess in the end it was an uncooperative brain.

I created the database user in cPanel...but never added the user in the database.  So, in the end, I am just an idiot...or I need more caffiene.  And this wasn't my first time.  Hey, I'm not afraid to admit when I'm stupid. :)

Now my next issue is restoring the database so all my old posts come back.  I already reinstalled the SMF software and all the mods. Now I just gotta figure out the restore.  Now going to research that. :)
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

xenovanis

Umm, did you install all the same mods you had on the "old forum"? How did you create the backup, is it with or without the tablestructure?
"Insanity: doing the same thing over and over again and expecting different results."

Mish

Quote from: xenovanis on April 11, 2007, 05:28:14 PM
Umm, did you install all the same mods you had on the "old forum"? How did you create the backup, is it with or without the tablestructure?

Pretty sure I got all of the major mods reinstalled.

The old forum on bravenet; I had to go into editing the database and I chose 'Export', it had all the files highlighted and I chose 'sql' as the file type with no compression, though I can choose zip and gzip if I wanted...I also exported a backup with gzip.

But those were the only things I lookeod at.  There are still other options. Such as export type options under 'Data': INSERT, UPDATE, or REPLACE.  Under 'Structure' it had 'Add AUTO_INCREMENT value' and 'Enclose table and field names with backquotes' checked but not 'Add DROP TABLE' or 'Add IF NOT EXISTS'. 

And I didn't choose a compatibility mode.  Should I?  I'm still able to go in and re-backup the old database.
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

xenovanis

Let me see if I can explain this understandably.

Assuming you included the tablestructure
  • If a "drop table if exists.." option in your database and you try to restore it in the database you're currently using for SMF, it will delete all existing tables with the same name, write new tables and insert the data. In which case, the columns created by modifications will also get lost. Which means the mods probably will fail.
  • If the "drop table" is not inserted, your restore will fail because the tables already exist.

Assuming you didn't include the tablestructure
Means that MySQL will attempt to restore the data in the existing tables.
  • If there is still data in the tables, the restore will probably fail due to duplicate entries; which means that unique id's already exists and therefore can't be replaced. You will have to truncate the tables before you can restore.
  • If your backup contains additional tablerows or columns added by a mod, which aren't in the new database because you forgot you ever installed that mod, the restore will fail because it can't find where to restore the data. And believe me, it's a pain to correct that.

I hope this all makes sense. It's just to explain MySQL a little bit :)

In the end, my suggestion would be to make a backup with the drop table included and restore it. (Here's some more information about restoring your database). It's possible you'll need to uninstall and reinstall some mods again, but it could also just work. Goodluck  ;)
"Insanity: doing the same thing over and over again and expecting different results."

Mish

I ended up importing it in through phpmyadmin and I got all my posts back!  Then I had a little message saying the default theme directory was off, so in my attempts to fix that, /themes/default/index.template.php doesn't wanna load anymore.

>:(

It seems to be if it's not one thing it's another.

But I'll keep trying.
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

xenovanis

You can fix that problem by running repair_settings.

Upload it to your forumlocation on server, point your browser at it and click all blue links to correct the urls and paths. Make sure the file Settings.php is writable.
"Insanity: doing the same thing over and over again and expecting different results."

Sarge

Quote from: xenovanis on April 11, 2007, 06:33:31 PM
You can fix that problem by running repair_settings.

Upload it to your forumlocation on server, point your browser at it and click all blue links to correct the urls and paths. Make sure the file Settings.php is writable.

You beat me to it. :D If I posted a few seconds earlier, you'd have to edit your post, not me :P

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

xenovanis

Quote from: Sarge on April 11, 2007, 06:40:59 PM
You beat me to it. :D If I posted a few seconds earlier, you'd have to edit your post, not me :P

lol

You'll need to type faster then  :P
"Insanity: doing the same thing over and over again and expecting different results."

Mish

*giggles at Sarge and xenovanis*

YAY!  It works again!  I have to reinstall the mods but at this point I don't care, that takes hardly any time at all now. :)

I probably would have thought of repair_settings if I wasn't getting frustrated at every little thing going wrong when I fixed something else.  It was still even on my desktop. XD

Thanks for all your help.  I shouldn't have any problems now! <3 <3 <3

And on that note, if you're into Halo or Gears of War or clan gaming on the xBox360, please check out the forum you helped me fixed, installed, and upgraded: http://section3.baddreamsinc.com/forum/index.php [nofollow] ;)

It's my boyfriend's forum that I fixed...I have my own at thedragoninn.net [nofollow] .  Now he better give me a backrub or something. :D
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

xenovanis

Be carefull if you reinstall the mods. Possible there are still traces of code in the files which could cause errors. If you run into any problems while installing them, it's best to upload all files from the installationpackage, except Settings.php, Settings_bak.php and install.php, so you can start over with a fresh set of files. Which wouldn't affect the database in any way, just the looks of your forum.
"Insanity: doing the same thing over and over again and expecting different results."

Mish

Quote from: xenovanis on April 11, 2007, 06:51:23 PM
Be carefull if you reinstall the mods. Possible there are still traces of code in the files which could cause errors. If you run into any problems while installing them, it's best to upload all files from the installationpackage, except Settings.php, Settings_bak.php and install.php, so you can start over with a fresh set of files. Which wouldn't affect the database in any way, just the looks of your forum.

Yeah, I just ran into one of those.

Now, when you say the looks of my forum...you don't mean that my posts are going to disappear again, right?  They disappeared from my main menu thing but they were still in the packages section.  I basically uninstalled and reinstalled all of them.  Only error message thus far is for the Country Flag one.
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

xenovanis

No, your database isn't going anywhere :)

Just make sure not to overwrite the files Settings.php and Settings_bak.php.
"Insanity: doing the same thing over and over again and expecting different results."

Sarge

Quote from: xenovanis on April 11, 2007, 06:51:23 PM
If you run into any problems while installing them, it's best to upload all files from the installationpackage, except Settings.php, Settings_bak.php and install.php...

I think that install.php is not needed after install; in fact, it should not be there at all -- if it is, delete it from the server.

http://section3.baddreamsinc.com/forum/install.php - Not Found
That's good. ;)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Mish

Quote from: Sarge on April 11, 2007, 07:00:44 PM
http://section3.baddreamsinc.com/forum/install.php [nofollow] - Not Found
That's good. ;)

Almost uploaded it again - but I caught myself.  Now to reupload again...so glad I have a ton of bandwidth now. XD  I think that if I was on any sort of free server they probably would have shut down the site by now. LOL
The Dragon Inn [nofollow] | UNSC Section 3 [nofollow]

Sarge

#19
Check the start of Themes/default/index.template.php

It seems to me that those strings that appear at the top of the page might be in the start of the file, before the opening <?php tag. If they are, delete them and reupload the file.

Of course, keep a backup copy just in case. :)

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Advertisement: