Support » Installing WordPress » Cannot connect to my blog or admin

  • After changing hosting providers I get the following message when I try to connect to my WordPress Admin:

    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    All of the files were transferred as far as I can tell. I contacted the new hosting company but they say it is something in the “scripting” and they don’t know where to look. My old hosting company is unresponsive which is why I left in the first place. All of my subdomains work fine but the blog does not.

    I also get the following when trying to connect directly to my site:

    Warning: require(/home/content/s/o/c/soccio97/html/wp-includes/compat.php) [function.require]: failed to open stream: No such file or directory in /home/content/s/o/c/soccio97/html/wp-settings.php on line 203
    Fatal error: require() [function.require]: Failed opening required ‘/home/content/s/o/c/soccio97/html/wp-includes/compat.php’ (include_path=’.:/usr/local/php5/lib/php’) in /home/content/s/o/c/soccio97/html/wp-settings.php on line 203

    I looked in my directory and the wp-includes folder is there and it does contain compat.php.
    However, the folder is under html/wordpress/wp-includes and not html/wp-includes. Could that have something to do with it?

    I apologize for my ignorance but I know nothing about this stuff, but if you can tell me where to go and what to do I can handle it. I’ll give whatever information is required to get this resolved. Please help!!

Viewing 15 replies - 1 through 15 (of 24 total)
  • Hey,
    If you’re using Control panel in your hosting.. check the PHP MyAdmin and look for an IP address for your db server.

    Put that IP instead of localhost and try again.

    it may work for your

    Regards,
    Mayooresan

    However, the folder is under html/wordpress/wp-includes and not html/wp-includes. Could that have something to do with it?

    so where is your install? In the root (/html) or in/html/wordpress?

    Thread Starter soccio97

    (@soccio97)

    The install is under html/wordpress. I installed on the instructions of GoDaddy.com. They are my new hosting provider. I was just reading that I should copy files to the new server. Which files?

    Thread Starter soccio97

    (@soccio97)

    I just found out that I no longer have access to the files on the previous server. I did however copy all the files, directories, filters and aliases to my hard drive yesterday. I was afraid this was going to happen.

    Can I just FTP and overwrite the old files to the appropriate folders on the new server?

    I noticed that the two config.php files are different. The password and user names are different along with the hostDB.

    Please help!!

    Might want to review Moving WordPress.

    Thread Starter soccio97

    (@soccio97)

    I did that earlier. Unfortunately, I no longer have access to any of the WordPress admin areas. Therefore I cannot complete the transfer according to the instructions. My previous hosting company has shut everything down. I’ve done everything I can find and am now down to “Error establishing a database connection”. I’ve checked the WP-Config and had to change the DB Name, DB User and DB Password but still nothing.

    You create the database at Godaddy. If you don’t know the password then change the password to the database and update the wp-config.php accordingly.

    Thread Starter soccio97

    (@soccio97)

    GoDaddy created a database. I went to wp-config.php and changed the content to the DB_name, DB-user, DB_password that I used to get into the database files. Still nothing. I also tried to change the DB-Host to the server name given to me by GoDaddy. Still nothing. What about the directory or database that was being created while I was with my other hosting company? I’m assuming that changes were being made as I added posts and changed themes, etc. Does that have to be loaded into the files at GoDaddy?

    Your posts/pages/content from your other host should be in either a database backup or an Export (WordPress WXR) file. You would restore the database or Import the WXR file.

    Thread Starter soccio97

    (@soccio97)

    I backed up the “Directory.sql” to my hard drive. When I imported it to the Database on GoDaddy it ran a series of queries and made some visible changes but still does not work. I can “ping” my site and the IP address that comes up is definitley GoDaddy but for some reason it can’t locate the database. I’m losing money and don’t know what to do. I did finally get in contact with my previous hosting company and her only comment was that WordPress and GoDaddy don’t get along and developers try to stay away from them.

    Soccio97,

    So there is a difference in the file structure/path between your old host and your new host, yes?

    Old host: /html/wp-includes/compat.php
    New host: /html/wordpress/wp-includes/compat.php

    Is that right?

    So on your new host you decided to install into a subdirectory called wordpress (/wordpress) instead of the root (/)? Is that right?

    Copying the files and db to a new host assumes that the file structure and db settings will be the same, which is an unreasonable expectation as each host will have their own spin on things. The trick is to figure out what is different and then where to update data to reflect the change.

    Things that may change include:
    your host account name e.g. soccio97 that may be used to prepend database information e.g. soccio_myWPdbname which is connected to by soccio_mydbUsername using this brand new password ‘*(yh*&^&*Yhuihui7’

    So you made those changes to the wp-config.php you said.

    Be aware that one host may call the html folder by some other name e.g. httpdocs, public_html etc. which kicks in if you must make absolute path declarations which you probably don’t. It does kick in when you’re FTP’ing stuff! You can’t just dump your old back up onto your new account’s server -the folder structure must match. How comfortable are you with FTP? I suggest connecting to your account with your FTP program and putting ONE file to where you think the root of your domain should be (inside the html/ or equivalent folder). If that file shows up where you expected, you’re on the right path. If it shows up somewhere else then you probably need to adjust where your FTP program thinks the root is! Do you see what I mean?

    What you do need to focus on is the WP install directory location. Is it at the domain root (html/) which gives http://www.yourdomain.com/ or is it in a subdomain (html/wordpress/) which gives http://www.yourdomain.com/wordpress/ ?

    I’ll wait for a response…

    GoDaddy created a database. I went to wp-config.php and changed the content to the DB_name, DB-user, DB_password that I used to get into the database files. Still nothing. I also tried to change the DB-Host to the server name given to me by GoDaddy. Still nothing.

    Just to be super-clear: The db_name values etc must be the new GoDaddy values. They may prepend your cPanel (or whatever they use) account name to that information -or not, what did they say to use? As far as the db_host value, that’s typically left as ‘localhost’ unless they specifically gave you some other value…

    Do you know how to create db’s on your new host? I ask this because it may be necessary for you to simply start over…

    Thread Starter soccio97

    (@soccio97)

    OK!! I really apprreciate all the help but again, I know nothing about this stuff and really don’t know what to look for. When you talk about the “values” I changed the WP-Config values to those of the GoDaddy database in other words the database name and User name (which are the same)and the password is the one I use to get access to the database.

    If I had to create a new database I guess I could ask GoDaddy to do that but they created the first one and my site did not work. I updated by importing the old database into it and it still doesn’t work.

    Urrgh, I see you’re a content aggregator.

    An example of the values are the ‘musnake_*****’ entries in the wp-config.php:

    // ** MySQL settings ** //
    define('DB_NAME', 'musnake_dbyaker');    // The name of the database
    define('DB_USER', 'musnake_sysyaker');     // Your MySQL username
    define('DB_PASSWORD', 'huiI7G76&8gG^(9t'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    I see from the web that GoDaddy offers a one-click install which results in yourDomain.org/wordpress/ which looks like what they did…

    This is a link to a step-by-step process for installing on GoDaddy. Look closely at steps 8 and 9 before you start all over!

    In the comments of that post is another, possibly better link for folks who have chosen a linux package with GoDaddy…

    You’ll be a pro at this in no time. Relying on GoDaddy will yield frustration…

    BTW, how much money are you losing?

    Thread Starter soccio97

    (@soccio97)

    The money I’m losing at this point is minimal. I was making $30-40 a month and growing (up from $2 just 4 months ago). I’m just getting started and have a lot of work to do includeing adding 85 more subdomains. I’ve been down now for 4 days so it’s only pennies at this point but I’m not any closer to a resolution.

    I’ll try what you suggest. I’m going to delete the WordPress directory and all the associated folders and files as well as the directory. I’ll then download WordPress again into the root directory and then recreate the database according to the link you provided. Then I go to WP-Config-Sample.php and change the DB_Name, DB_User, and DB_Password. The link also suggest changing the DB_Host as well, so I’ll do that and then save everything as WP-Config.php. Then I’ll FTP all the files back into the new WordPress folders.

    The funny thing is I’ve been messing around with this every chance I had for 4 days and I know just how to get all this done. Like you said, I’ll be a pro in no time.

    Then I’ll get back to you and let you know how it went.

    Thanks for the help.

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Cannot connect to my blog or admin’ is closed to new replies.