• I reviewed all in the wp-config file and I think there may be a problem wit the localhost. I have XAMPP already installed – could that be a problem and do I need to change ‘localhost’ in the config file?

Viewing 14 replies - 1 through 14 (of 14 total)
  • For xampp localhost should be fine.
    Do you have a user with a password in the database?
    On my XAMPP install the user is “root” and it can access the db even without a pw, but for WP to work correctly I had to give the user a pw.

    Thread Starter zen-cowboy

    (@zen-cowboy)

    i’m sorry i did not communicate clearly – i want to install WordPress on a hosted website; I had previously installed XAMPP on my computer as atest and I don’t use it much;

    when i tried to install WP on the host site i got the error message – so i checked evrything several times – the database and user names as well as the password are ok – so I was wondering maybe a different host name needs to be specified – you think?

    needless to say i am not the most computer literate – just a blogger

    That’s fine – we re all bloggers πŸ™‚
    If “localhost” doesn’t work, you should ask your host what the DB host is.
    Was the database created by you or by the host? WHat admin interface do you have: cPanel, Plesk…other?
    At this place http://www.tamba2.org.uk/wordpress/ you can find several tutorials for different admin panels.

    I’m receiving the same problem.

    I figured I should post it here, in case we have the same issue. I don’t use a cpanel though.

    DB_NAME
    DB_USER
    DB_PASSWORD
    DB_HOST

    coorespond with the following info which I will post in the next post.

    here I’ve created the database

    mysql> CREATE DATABASE wordpress;
    Query OK, 1 row affected (0.00 sec)

    here I’ve enabled use of the database

    mysql> USE wordpress
    Database changed

    here I created an account, and gave it access to the entire database wordpress

    mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
    -> ON wordpress.*
    -> TO ‘user’@’localhost’
    -> IDENTIFIED BY ‘password’;
    Query OK, 0 rows affected (0.00 sec)

    here I test the login, from the localhost

    bash$ mysql -u user -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 6 to server version: 4.1.13

    Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

    so… at this point mysqld is running, and the user has access to the database.

    I also ran some simple tests to verify that everything had been created properly

    for example:

    mysqlshow -p
    – to see the databases

    mysql -e “SELECT Host, Db,User FROM db” mysql -p
    – to see the database association with an account

    all this data cooresponded appropriately with the above….

    the only thing I can think of is….

    “table_prefix”

    does “wp_” have to be created manually?

    does wordpress not create this?

    If I install mysqladmin… do you think it will solve my problem? Or is there some other issue at hand here?

    I’ve configured alot of databases manually… but never outside of a win32 environment. So I am new at configuring mysql on *nix, but with mysql it should be the same cross platform yes?

    I meant… phpmysqladmin btw.

    I am facing similar problem

    I Cerated Data base user name as well as password

    But when run the install.php script I get the follwing error

    “Can’t select database
    We were able to connect to the database server (which means your username and password is okay) but not able to select the hnewar11_blog database.

    Are you sure it exists?
    On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem? “

    Well any one can solve this problem

    Mohammed

    You need to link the database with the user.
    If you are using cpanel, take a look here:
    http://www.tamba2.org.uk/wordpress/cpanel/
    “The Really Important Bit”

    what about for me? πŸ™‚

    just a simple typo or something not sure
    but it works now.

    nevermind.

    Ok, I get a similar error only have some of the time. I noticed when I tried a plugin demo, one of the contributors page gave me the same message.

    I know the connection works at least some of the time (60%) or more, but at least ever hour I get the
    Error establishing a database connection etc, etc.
    Problem goes away in only a couple of minutes.

    Anything in wordpress that may cause this? If not, I use CPanel, MySQL, and PHP MYADMIN to configure everything. I have not set up a generic localhost name, just left the “localhost” as it was.

    Any thoughts? I am leaning toward the host since the sites I host on my servers don’t have the same trouble.

    I would also lean toward it being an issue with that particular host.

    in my case it wasn’t any problem with wordpress

    i just had the password wrong in the wordpress config

    apparently the one i was logging into mysql was different

    that day I would have sworn up and down they were the same but I came back another day and tried logging in with the password in the config file and it wouldn’t work; so i reset the password.

    sometimes the best thing to do is, walk away and come back a few days later with a fresh mind.

    Podz etc.: πŸ™‚ amazing how important the “really import bit” is, and how eaysy it is to miss the add user to database button once you’ve allready created both the user and database, bad lay-out of the cpanel i say! thanx for clearing it up.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Can’t connect to database – error message’ is closed to new replies.