News:

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

Main Menu

Cannot Connect to Database.

Started by tyqre, January 19, 2011, 06:25:21 PM

Previous topic - Next topic

tyqre

I have moved my forums directory to another computer but all the links etc. stayed the same.  Is there any way to fix this? It went from C:/xampp/xampp/htdocs/comm to D:/xampp/htdocs/comm . Everything should still work as far as im concerned. phpMyAdmin still works (i can log in atleast) and MySql is running.
There is a database called cdcol , infromation_schema, mysql and phpmyadmin. Are any of these part of my forum?

Illori


tyqre

#2
i just went back to the backup to start fresh, i backed the database and i am now ready to migrate to new server. What do i need to do to get it back to normal (i was using a theme).
Do i install a new SMF and add the theme and the database ?

Tyrsson

Move your files to the root of the webspace and then load the repair settings file in a browser to reset the file paths. Once that is done login and go to admin=>themes and layout->attempt to reset all themes. The repair settings tool only repairs the default themes file paths.
PM at your own risk, some I answer, if they are interesting, some I ignore.

tyqre

#4
Quote from: Tyrsson™ on January 19, 2011, 07:55:04 PM
Move your files to the root of the webspace and then load the repair settings file in a browser to reset the file paths. Once that is done login and go to admin=>themes and layout->attempt to reset all themes. The repair settings tool only repairs the default themes file paths.
So is this with my original set up? Just copy and paste my old directory to the new one and do as you said?

I dont see a "repairsettings.php" or anything with repair and settings in the same file name.

Another question would be - "How do I add the database i backed up to phpmyadmin?"

Tyrsson

One more thing.

If you look in the top level of the smf files and open Settings.php in a text editor that supports php and look for the value for $db_name that should be the value in phpmyadmin.

Doesnt matter which setup. Place them in the folder the server serves files from. The Doc root.
PM at your own risk, some I answer, if they are interesting, some I ignore.

tyqre

#6
Ok, so i have everything in place except for one thing. The reason why it wont work ( i believe ) is because the database is not present. I do not know how to add the mysql database back with phpmyadmin. When ever i try to add the database back i get an error. I have tried two times.

It keeps giving me the error "No database selected".


I got the mysql database in phpymadmin successfully now. But i still get "Sorry,SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later."

Illori

have you run the repair_settings.php file?

tyqre

Quote from: Illori on January 19, 2011, 08:27:22 PM
have you run the repair_settings.php file?
If its in the root of smf install, i cant find it.

tyqre

#9
GOT IT TO WORK! Thaks for all your replys. Turns out that i had no password for phpmyadmin this time. Thanks. Dont mark solved though, not yet because i still have some errors on my page.
Now it says that my page's template is wrong and click here to fix it. I click and it just loads for ever with the "Login" header.

Tyrsson

add this to the url right after the ?

theme=1 so it becomes:

http://www.testdomain.com/index.php?theme=1

This should load the default theme and allow you to login so that you can reset the custom themes filepaths.
PM at your own risk, some I answer, if they are interesting, some I ignore.

tyqre

#11
it doesn't load the error anymore but it just keeps on loading forever.
Is there any way to do this manually without going to the website? It only works if i load it with my phone but when i try to log in with the default theme it just loads forver too. Do you think this could be my server? it only has  a 1.66Ghz processor and 2GB of ram. The server isn't struggling to keep up with anything ( only about 20% of processor is being used)

Illori

can you provide a link to your forum?

tyqre

Quote from: Illori on January 20, 2011, 08:03:34 PM
can you provide a link to your forum?
http://xxfsu.com <-- its a Call of Duty: Black ops clan forum

Illori


Joker™

Try resetting the paths using repair_settings.php as told by Illori earlier also, after that go to

Administration Center » Themes and Layout » Theme Settings >> Reset Theme URLs and Directories (use this option)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved


tyqre

#17
Quote from: Joker™ on January 21, 2011, 03:06:31 AM
Try resetting the paths using repair_settings.php as told by Illori earlier also, after that go to

Administration Center » Themes and Layout » Theme Settings >> Reset Theme URLs and Directories (use this option)
I do not have repair_settings.php in my smf  forums directory. Also, my web browser will not load the forum anymore but if i go on the forum with my iphone it will load but it takes 30 seconds to load each page.

Interesting= it some what works now, it keeps telling me my default directory is wrong but I am sure that it is right.

Joker™

Download repair_settings.php from here >> http://download.simplemachines.org/index.php?thanks;filename=repair_settings.php

upload it to your root directory and run it. Set the paths as shown by that file.

After that open your forum after that go to

Administration Center » Themes and Layout » Theme Settings >> Reset Theme URLs and Directories (use this option)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Illori

i tried for over 30 minutes to connect to your site, it did not even load that it can not connect to the database. are you hosting this forum on someone's personal computer connected to a free domain redirect service then directing to your purchased domain?

Advertisement: