• agmal

    (@agmal)


    hello every 1
    i always got this erorr msg

    “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.

    Are you sure you have the ?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running? “

    I’m sur that i have the correct username and password and typed the correct hostname and the datebase is running ??
    so where is the proplem
    i laso sometimes can’t get step 2

    I tryed to use word press in local host and it’s worked well
    but when i tryed it in my site i can’t :S so are the proplem from the cpanel ?

Viewing 15 replies - 16 through 30 (of 36 total)
  • moshu

    (@moshu)

    The only other thing I can think of… is the user added to the database?
    (I know how to do it in CPanel, but have no clue about other admin interfaces, sorry.)

    goodfish

    (@goodfish)

    I will check that, thanks very much!

    I am having the same problem with network solutions and was wondering has any solution to this problem been found?

    I am stuck on the exact same problem.

    I am using:
    Host: Lunarpages / cpanel X
    PHP version 4.3.10
    MySQL version 4.0.22-standard

    I’m almost positive my wp-config.php file is configured correctly.
    Can anyone using similar tools (cpanelx) reply with advice?

    It finally worked for me and I think the problem was that my login and password were the same words, or perhaps that my database name was the same my login name.

    Anyone having trouble with this step should try diversifying those.

    i finally got it! turns out (with me anyway) i’m one of the 1%!
    it worked when i changed ‘localhost’ to the address of my mysql thingy i.e.

    define(‘DB_HOST’, ‘localhost’);

    became

    define(‘DB_HOST’, ‘205.XXX.XXX.XX’);

    I’m running into this ‘Error establishing a database connection’ problem as well.

    -Win2K
    -MySQL 4.1.11
    -php 4.3.10

    The wp-config settings should be fine. I’ve set up wordpress on a few other systems (however this is the first Windows installation I’ve attempted)

    Using MySQL Admin I can connect to the service as localhost.
    Tried substituting 127.0.0.1 in place of localhost, as well as a couple other IP’s bound to the system, and the actual machine name. None of these worked. I also tried adding enable-named-pipes to my.ini, and restarted mysql, but it wouldn’t start after that.

    I’ve also ensured that my username is able to connect from localhost, as well as remotely. Seems to work using mysql admin tools, but not in WordPress.

    Any other things that I should look at?
    tia

    in your php.ini file try setting doc_root = “leave blank” and make sure my.ini (for mysql) is under your c:\windows dir

    [mysqld]
    basedir=C:/MySQL/
    datadir=C:/MySQL/data

    with the following placed inside

    thanks for the reply…I did check the php.ini, and the mysql my.ini, and all looks good there.

    I did come across a reference to the old_password() function in mysql, and I applied this function to the user that I am using for the wordpress database.

    Now, instead of the connection error, I recieve a page full of errors similar to this:

    Warning: Invalid argument supplied for foreach() in \path\to\wordpress\wp-includes\functions.php

    WordPress database error: [Table ‘my_database.wp_options’ doesn’t exist]
    SELECT option_value FROM wp_options WHERE option_name = ‘permalink_structure’

    problem resolved after upgrading php and reinstalling mysql. Part of the problem was the mysql user accounts… had to create a username@localhost acct, not just username

    As an FYI, if you are using a Network Solutions hosting account, you can not specify the MySQL database as localhost. You have to go to where you created the MySQL Database in the Hosting Control Panel and get the IP address on that page and use that.

    Good Luck

    I’m also using Network Solutions, everything is working, but from time to time (alot of time:-) I keep getting the “Error establishing a database connection”. Do you experience those on Network Solutions? If not, how did you do the trick ??

    I found this topic (#26705) while trying to resolve my problem, which was the inability to log in to the remote database server using MySQL Administrator to perform a backup of a WordPress database for a blog hosted on lunarpages.com. Here is what I did to solve the problem.

    I am using MySQL for a WordPress blog hosted by lunarpages.com. I installed WordPress using Fantastico from the lunarpages.com CPanel. Regrettably, CPanel and Fantastico have defaults which caused problems.

    CPanel/Fantastico prefixes the lunarpages.com username (“foo”) to whatever username and database name the user specifies when creating the database. If no name is specified, the default is “wrdp1”. Moreover, CPanel/Fantastico by default makes the user name the same as the database name. So if you specify “bar” as the WordPress database name and your lunarpages.com username is “foo”, the WordPress user name will be “foo_wrdp1”. Likewise, the database name will be “foo_wrdp1”.

    I am running a Linux system, namely, Debian “sarge”. I installed the package “mysql-admin”, which is the MySQL Administrator. After several unsuccessful attempts to connect to the database server at lunarpages.com, I found in this topic a suggestion to change the username to a value distinct from the database name. So, using “MySQL Account Maintenance” in CPanel, I added user “bar”, which CPanel turned into “foo_bar”. So, with username “foo_bar” and servername “mydomain.com” (omitting the “www.”), I was able to connect to the MySQL server at lunarpages.com, using MySQL Administrator.

    My primary goal was to backup the database “foo_wrdp1”. However, I discovered that the only database which mysql-admin could see was an empty data base with the schema (that is, name) “test”. The problem turned out to be that user “foo_bar” had not been added to the user list for the database. So, I went back into “MySQL Account Maintenance” in CPanel and add user “foo_bar” to the user list for database “foo_wrdp1”. When I exited and then restarted mysql-admin, I found “foo_wrdp1” listed as a schema, and now I am able to inspect the tables of the schema and perform a backup.

    For me (Mac OSX 10.4.3, MySQL 5.0.13) updating the PHP module from version 4.x to 5.0.4 solved the problem (tx astrashe!).

    Re: Installing WordPress on a Network Solutions (NS) hosted web site.

    After uploading my files to my Network Solutions hosted web site, I entered the obligatory
    https://www.adiatha.com/blog/wp-admin/install.php

    and got the following error:

    “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?”

    I solved the problem with the following procedure:

    Opened the NS Hosting Control Panel.
    Clicked on “database manager.”
    Clicked on “mySQL database.”

    Saw the numbers under “Server IP.” There was an entry similar to this one:
    123.456.789.99

    Used that number to change the following line in the wp-config.php file:

    define(‘DB_HOST’, ‘123.456.789.99’); // 99% chance you won’t need to change this value

    Then uploaded that changed wp-config.php to my web site.
    Now when I aimed my browser at https://www.adiatha.com/blog/wp-admin/install.php
    and hit ENTER it all worked.

    P.S. Thanks to jeepfun for his former post that led me in this direction. Posted this step-by-step procedure for other newbies like me.

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