WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing database connection (11 posts)

  1. minh
    Member
    Posted 10 years ago #

    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.

  2. bAs
    Member
    Posted 10 years ago #

    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

  3. minh
    Member
    Posted 10 years ago #

    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?

  4. pericat
    Member
    Posted 10 years ago #

    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.

  5. minh
    Member
    Posted 10 years ago #

    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 :)

  6. pericat
    Member
    Posted 10 years ago #

    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.

  7. Anonymous
    Unregistered
    Posted 10 years ago #

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

  8. pericat
    Member
    Posted 10 years ago #

    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.

  9. bAs
    Member
    Posted 10 years ago #

    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.

  10. laslo
    Member
    Posted 8 years ago #

    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

  11. moshu
    Member
    Posted 8 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.