• Evening all,

    As advised on wordpress i decided to go with ‘bluehost’ as my host.

    I’m currently trying to connect my sql database to the server.

    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?

    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    Is what it comes up with.

    Question 1 :

    Would the database name be in this case ‘bneklive_xxx’ or just ‘xxx’?

    define(‘DB_NAME’, ‘bnek’); // The name of the database

    Question 2 :

    Secondly bluehost say the host name is ‘localhost’, is this definately correct?

    define(‘DB_HOST’, ‘localhost’);

    I’m stumped!

    Regards!

Viewing 15 replies - 1 through 15 (of 15 total)
  • I just ran into this as well with BlueHost. I have 7 of my blogs hosted here, and in the process of setting up my 8th, got the same error message. All of the other installs went flawlessly…. Anyone have any ideas?

    Hello,
    First time here.
    I have the same problem and would appreciate any help.
    Thanks.

    I’m on Godaddy and cannot get the database to get recognized.

    heartland I answered you godaddy issue in another post. it would be best to make your OWN post instead of someone elses and try not to CROSS-POSTS (posting the same thing in more than one thread)

    bnek, if your database name is “bneklive_xxx” then that’s the name — not “xxx”. Try that.

    Thread Starter bnek

    (@bnek)

    already tried that ??

    Okay. What I was saying is that if, for instance, your host provides cPanel, and you set up a database named “xyz” — cPanel will append that to your web hosting account username (something like “username_xyz”).

    It does the same thing with the database user name.

    I just took a look; it looks like Bluehost does provide cPanel. How are you setting up the database?

    I had the same problem. Here were my fixes:

    1) My hosting service is 1and1. localhost is NEVER right with them – there’s a specific host name that looks something like dbNNNN.perfora.net. I figured that out but it still didn’t work.

    2) My text editor had added the file extension txt to the end of wp-config. As soon as I edited the filename back to wp-config.php everything worked perfectly.

    I hope this posting saves someone else the hour I wasted.

    Im wasteing more hours ont his, but dont want to give Up . Since begining I have the same problem and now , I can not even see that my domen is runing properly . Anyway , I tryed all posible variants of name, host and other DB information ,but It just can not be connected.

    p.s : last post 6 mounth ago ? ^^

    icm, 99.99999% chance you have entered the wrong information into your wp-config.php (or not uploaded it to the correct place). The most common mistakes are:

    1. Adding an extra blank space before after the User name or DB name or password

    define(‘DB_NAME’, ‘myDBname’); Correct
    define(‘DB_NAME’, ‘ myDBname’); Incorrect

    2. Missing the ‘ before or after the User name, DB name or password

    define(‘DB_NAME’, ‘myDBname’); Correct
    define(‘DB_NAME’, myDBname); Incorrect

    3. Having ‘Localhost” as the DB host when your ISP actually uses a separate DB hosting server. You may need to double check this with your host.

    The best way to check these details is to try connecting to your database using phpMyAdmin instead of WordPress. If you can’t connect you know the details are wrong and you can check with your hosting company. If you can connect then we eliminate that and work out what the next option is. Report back once you have done the test.

    I’ve got the same problem with bluehost.
    I check all the information in wp-config and is correct.

    The host name definitly isn’t localhost for bluehost but … we don’t know which is the correct …

    I’m desperate

    Follow these intructions and everything should be fine.

    https://bluehostforums.com/showthread.php?t=10935&highlight=wordpress

    When you download the wordpress-2.3.2 zip file from www.ads-software.com, don’t unzip it. Just upload the zip file to bluehost with the Legacy File Manager.

    ‘ve got the same problem with bluehost.
    I check all the information in wp-config and is correct.

    The host name definitly isn’t localhost for bluehost but … we don’t know which is the correct …
    Those two statements are contradictory. If you don’t know the host name for bluehost then how can the info in wp-config be correct?

    Those two statements are contradictory. If you don’t know the host name for bluehost then how can the info in wp-config be correct?

    karlinhos put in all the correct information as he had it when he created the directories, but assumed the host name for bluehost wasn’t localhost because he was still getting the error message that bnek posted at the top of this thread.

    I had been dealing with the same problem for the last couple days. until I found the instructions in my post above.

    i put ‘ and now not error myDBname’); because i have a new page. and upload all files again. but this time dont be error ?? thanks guys
    flash web tasarimi

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.