WordPress.org

Support

Support » Installation » Error establishing database connection

Error establishing database connection

  • Hi all,
    I’ve been trying to install wordpress v 1.2, but kept getting this:
    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.
    Are you sure you have the correct user/password?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running?
    my database name and username is inspers_minh and i’m currently hosted on a subdomain. i am very sure the database name and username are correct and that she has assigned my username to the database, since i’ve gotten my host to doublecheck for me.
    the copy&paste that she has given me is:
    inspers_minh
    Users in minh
    inspers_minh (Privileges: ALL PRIVILEGES)
    Connection Strings
    Perl $dbh = DBI->connect(“DBI:mysql:inspers_minh:localhost”,”inspers_minh”,”<PASSWORD HERE>”);
    PHP $dbh=mysql_connect (“localhost”, “inspers_minh”, “<PASSWORD HERE>”) or die (‘I cannot connect to the database because: ‘ . mysql_error());
    mysql_select_db (“inspers_minh”);
    help, anyone? i can’t wait to get wordpress up and running on my site.

Viewing 10 replies - 1 through 10 (of 10 total)
  • do you have phpmyadmin access? or some sort of cpanel in order to creat the db or edit the user/pw for it?
    $dbh = DBI->connect("DBI:mysql:database_name:localhost","database_username","<PASSWORD HERE>");
    PHP $dbh=mysql_connect ("localhost", "database_username", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("database_name");

    it looks like your using the same username for the database name.
    you need 4 things to hook up:
    database username
    database name
    localhost
    password

    nope i don’t have phpmyadmin/ cpanel access, but i can get my host to edit for me. so i guess the database name has to be different from the database username?

    my database’s name and my username are the same, so I don’t think that can be your issue.
    Try this, if you like. Create a file on your website so:
    <?php
    $server='localhost';
    $user='inspers_minh';
    $pass='your-password';
    $pipe = mysql_connect ($server, $user, $pass);
    echo $pipe;
    ?>
    Name it whatever you like .php. Then run it in a browser. If you get a response such as ‘Resource ID’ somethingorother, you have a valid connection. If not, you’ll get a honking big error message. At which point, you need to bug your provider again.

    I got this: Warning: mysql_connect(): Access denied for user: ‘inspers_minh@localhost’ (Using password: YES) in /home/inspers/public_html/minh/me.php on line 5
    So i shall bug my host again (hope she won’t be annoyed!)
    Thanks for the help 🙂

    Bug her. Show her the output. I suspect she’s made a typo in setting up your username. Either that, or your password is not what you think it is. Either way, you’ll have to ping her again to double-check those items.

    I’m having the same exact problem / same results.

    Then, at least so far, the solution is the same. Talk to your provider, and explain that MySQL won’t accept your username or your password, and could they provide you with a new set.

    If your host doesn’t allow you to have access to phpmyadmin to work your database – you may want to consider a new one. Yes the username and database name can be the same, but check anyway. phpmyadmin allows you to work on your own database with an easy gui. especially usefull if you locked yourself out and need to reset your password for your wp. I have my hosting through http://www.pehosting.com their site gives an example of what you get.

    hello pericat,
    I’m having the same problem that everybody with installin.php
    i ran the test script you suggested, and i’ve got
    “No input file specified.”

    any ideas?
    http://www.imaginaccion.net/cinencuentro/test.php

    That means you don’t have a valid connection to your database. Are you sure all the 4 pieces of information in the wp-config file are correct?

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