Support » Installing WordPress » Install.php trouble – can’t connect to database

  • Hi! I’m on my third blog software and 30th installation attempt. This is the error message I get:


    Error establishing a database connection! This probably means that the connection information in your wp-config.php file is incorrect. Double check it and try again.

    Server info:
    Apache server – have Telnet/Shell access but have never used this kind of interface and don’t know what I’m doing. Has PHP and SQL capability, not sure which versions but they do offer b2 blog support. I tried installing that as well and couldn’t get it to work either. I’m on a Mac OSX, if that’s of any help.

    I’ve had trouble with step 3 from the installation guide: I have access to a MySQL admin tool, but it does not allow me to do anything related to adding users or setting their access privileges. As far as I can tell, my admin access privileges have been set everywhere the admin interface allows me to set them.

    Would anyone be willing to walk me through the install or tell me what I’m doing wrong? I want my life back.

Viewing 4 replies - 1 through 4 (of 4 total)
  • And minutes later, I got it!
    I’ve been staring at the monitor for too long and missed a glaring error.

    Good night!

    > I want my life back

    I know what you mean. 🙂

    Let’s take this from the beginning. First, it doesn’t matter what your own computer operating system is; what matters is what is running on the server where you wish to install WordPress. Apache is fine, but there are some specific server requirements for running WP:

    Server Requirements

    Secondly, the “error establishing a database connection” issue does usually mean that the info you put into wp-config.php contains an error(s). The thing to know here is that you cannot invent data to insert in wp-config.php. If you’re using commercial web hosting *who offers a mySQL database*, then the web host would likely have set up a database for you and should have provided the username, password and database name that you would input into the wp-config.php file:

    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’); // The name of the database
    define(‘DB_USER’, ‘username’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘password’); // …and password
    define(‘DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value

    Web hosts will usually have given a different database name than “wordpress” when you signed up, and will have given you a username and password as well. The last issue is DB_HOST; I’ve found that some web hosts want you to use your domain name: So, IF you are using a web host, I’d contact them to see what data they’ve given you.

    Lastly (or firstly), if you’re trying to install WordPress on your own server, you’ll first need to start the database yourself via SSH (a kind of secure telnet) by logging in as root and going to the mysql prompt:

    % mysql -u root -p
    % pwd typeroot’spasswordhere
    % CREATE DATABASE typeadatabasenamehere;

    => This IS where you can make up a name for the database. Personally, I would call it something other than “wordpress”, simply to differentiate between that and every other mention of wordpress. Every little bit helps. 😉

    Oops; you’d posted before I did. Glad you got it.

    I think I’m going to post this on my blog for easy access next time.

    Moderator James Huff


    Volunteer Moderator 🚀

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Install.php trouble – can’t connect to database’ is closed to new replies.