Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Mish on April 09, 2007, 07:38:02 PM

Title: Uncooperative database or SMF...not sure which.
Post by: Mish on April 09, 2007, 07:38:02 PM
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. :)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: metallica48423 on April 09, 2007, 07:45:41 PM
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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: xenovanis on April 09, 2007, 08:10:04 PM
A couple of things you could check:
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 10, 2007, 07:50:24 PM
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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: metallica48423 on April 10, 2007, 09:49:00 PM
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
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 05:24:03 PM
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. :)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: 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?
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 05:37:00 PM
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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: xenovanis on April 11, 2007, 05:56:31 PM
Let me see if I can explain this understandably.

Assuming you included the tablestructure

Assuming you didn't include the tablestructure
Means that MySQL will attempt to restore the data in the existing tables.

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 (http://docs.simplemachines.org/index.php?board=81.0;sort=subject)). It's possible you'll need to uninstall and reinstall some mods again, but it could also just work. Goodluck  ;)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 06:30:35 PM
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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: xenovanis on April 11, 2007, 06:33:31 PM
You can fix that problem by running repair_settings (http://www.simplemachines.org/download/index.php?thanks;filename=repair_settings.php).

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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 06:40:59 PM
Quote from: xenovanis on April 11, 2007, 06:33:31 PM
You can fix that problem by running repair_settings (http://www.simplemachines.org/download/index.php?thanks;filename=repair_settings.php).

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
Title: Re: Uncooperative database or SMF...not sure which.
Post by: xenovanis on April 11, 2007, 06:42:20 PM
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
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 06:46:42 PM
*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 ;)

It's my boyfriend's forum that I fixed...I have my own at thedragoninn.net .  Now he better give me a backrub or something. :D
Title: Re: Uncooperative database or SMF...not sure which.
Post by: 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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 06:56:27 PM
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.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: xenovanis on April 11, 2007, 06:57:43 PM
No, your database isn't going anywhere :)

Just make sure not to overwrite the files Settings.php and Settings_bak.php.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 07:00:44 PM
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. ;)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 07:06:34 PM
Quote from: Sarge on April 11, 2007, 07:00:44 PM
http://section3.baddreamsinc.com/forum/install.php - 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
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 07:10:44 PM
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. :)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 07:18:09 PM
I had already reuploaded the file by the time the email notify for this came into my inbox, it's still there.  I checked the file anyway and it's still there.

Either that or I'm moving faster than my FTP program can handle.  It's still scrolling stuff. O:)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 07:25:20 PM
If those // Pogo Awards lines are still there after your FTP program stops "scrolling stuff", download Themes/default/index.template.php via FTP, open it in a text editor and look at the start of the file. Can you show us the first 10 lines?
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 07:29:58 PM
Quote from: Sarge on April 11, 2007, 07:25:20 PM
If those // Pogo Awards lines are still there after your FTP program stops "scrolling stuff", download Themes/default/index.template.php via FTP, open it in a text editor and look at the start of the file. Can you show us the first 10 lines?

Sure can.  I can grab it right out of my file manager without having to download anything (yay cPanel!).

Quote<?php
// Version: 1.1; index

/*   This template is, perhaps, the most important template in the theme. It
   contains the main template layer that displays the header and footer of
   the forum, namely with main_above and main_below. It also contains the
   menu sub template, which appropriately displays the menu; the init sub
   template, which is there to set the theme up; (init can be missing.) and
   the linktree sub template, which sorts out the link tree.

   The init sub template should load any data and set any hardcoded options.

   The main_above sub template is what is shown above the main content, and

That the right stuff?  And would reinstalling the mods make the message go away?  I did have more scribble than that, but after uploading a bunch of files again most of it went away.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 07:55:17 PM
Quote from: Mish on April 11, 2007, 07:29:58 PM

That the right stuff?  And would reinstalling the mods make the message go away?  I did have more scribble than that, but after uploading a bunch of files again most of it went away.

Yep, that's the right stuff (the one that should be there, not the one that shouldn't). So those offending lines are elsewhere.

No, I think that reinstalling the mods would probably not resolve this particular issue.

Download all of the forum directory into your desktop. Do you have a text editor that can search in all files inside directories? If your PC is running Windows, you can also open the directory with Windows Explorer and press the F3 key to find where Pogo Awards is. Use these options:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg412.imageshack.us%2Fimg412%2F3263%2Fsearchhk7.png&hash=7e998f8e93182a9ce935425565924b051c5e503e)

If your PC is running Linux, use grep or a visual search tool.
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 08:26:14 PM
I've read good reviews about Notepad++. Among other things, it can find text in files inside directories.

http://notepad-plus.sourceforge.net/uk/site.htm

For quick results, download the zipped distribution of Notepad++, run notepad++.exe from within the ZIP archive and press Ctrl+Shift+F or select "Find in files..." in the Search menu. Use options similar to below:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg387.imageshack.us%2Fimg387%2F9859%2Fnpplusplusxg9.png&hash=ce4491e90f723af8d45ec9cfb2361cc785a19deb)

When you find where the offending lines are, delete them and reupload the edited file(s). Make sure that you only delete lines from the start of file(s), before the opening <?php tag, and of course keep a backup copy.

If the problem persists, feel free to ask for help again. :)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: metallica48423 on April 11, 2007, 08:32:32 PM
I'd put 10 bux on it that they're in /Themes/default/languages/Modifications.english.php

At the bottom.

Check to make sure that everything is ABOVE the ?>

// Pogo Awards adminIndex text strings. $txt['awards'] = 'Awards'; $txt['pa_view_album'] = 'View member\'s badge album.'; $txt['pa_mods'] = 'Mods'; $txt['whoallow_pogoawards'] = 'Managing Awards.';

Those are language strings, as defined by $txt
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 08:36:26 PM
The last ten lines of Modifications.english.php

Quote$txt['permissionname_payPal_view'] = 'View Donation Page';
$txt['permissionhelp_payPal_view'] = 'Allow the people to view the Donation Page.  If not set, the people will not see the page.';
?>
// Pogo Awards adminIndex text strings.
$txt['awards'] = 'Awards';
$txt['pa_view_album'] = 'View member\'s badge album.';
$txt['pa_mods'] = 'Mods';
$txt['whoallow_pogoawards'] = 'Managing <a href="' . $scripturl . '?action=awards">Awards</a>.';

So I delete everything after ?> right?
Title: Re: Uncooperative database or SMF...not sure which.
Post by: metallica48423 on April 11, 2007, 08:40:44 PM
Thats your culprit.


No, just move it above it.  copy & paste
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Mish on April 11, 2007, 08:44:54 PM
That did it!!  Thank you so much!!! <3 <3
Title: Re: Uncooperative database or SMF...not sure which.
Post by: metallica48423 on April 11, 2007, 08:52:48 PM
No problem.  Enjoy :)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: Sarge on April 11, 2007, 09:34:33 PM
I learn something new every day. :)
Title: Re: Uncooperative database or SMF...not sure which.
Post by: metallica48423 on April 11, 2007, 10:03:51 PM
'Tis the nature of the beast ;)