Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter redtruck

    (@redtruck)

    Hi All,

    I don’t know where to suggest that this be made sticky or put in the FAQ or what, but it boils down to this: Failure to connect to the MySQL database isn’t always a user typing problem. So if you are absolutely certain that:
    1. you set up your MySQL database correctly
    2. you set up your MySQL user and password correctly
    3. you added your MySQL user to your MySQL database correctly
    4. you edited your wp-config.php to include your DB_name, DB_user, DB_password and DB_host correctly

    and still, when you attempt to run the install.php program, you get the dreaded “Error establishing a database connection,” go directly to your host and tell them you’re not able to connect to a simple MySQL database with a simple PHP program.

    If they point to WordPress and declare that they’re not responsible for making WordPress work, if you’re using cPanel, go back to your cPanel, and click on MySQL and look for the “connection strings. Copy the PHP connection strings into a text file and add some PHP stuff around it thusly:

    <?php
    $dbh=mysql_connect ("<HOST NAME HERE>", "<USERNAME HERE>", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("<DB NAME HERE>");
    ?>

    The HOST NAME, USERNAME and DB NAME should already be filled in correctly from your cPanel/MySQL display. Fill in your PASSWORD where indicated. Then save this file as a PHP file with a name like mysql-test.php. Upload it to your hosting account. I’d suggest you put it in your “document root.” Then open your browser and go to: https://www.yourdomainname.com/mysql-test.php
    If you get an error message, take that to your host and say “This doesn’t have anything to do with WordPress, I can’t connect to a simple MySQL database on your server with a simple PHP program.” This takes WordPress out of the picture and gives your hosting company a relevant error message to work with.

    Further, if the error message is: “Client does not support authentication protocol requested by server; consider upgrading MySQL client.” refer your hosting company to:
    https://dev.mysql.com/doc/mysql/en/old-client.html

    Hope this helps. Many thanks to all for their help. Bob

    Thread Starter redtruck

    (@redtruck)

    Thanks for the Tamba2 link. I was following those exact instructions. However, your direction on confirming “localhost” led me to look more closely at the connection string for PHP. I put this string in a copy of index.php and called it with my browser and got this mysql_error message: “Client does not support authentication protocol requested by server; consider upgrading MySQL client”.

    A further search on Google rendered information at: https://dev.mysql.com/doc/mysql/en/old-client.html which relates to versions of PHP, MySQL and client libraries and starts to point back to potential problems with my server. While I’m sure my other MySQL driven applications are working, I’ll address this to my hosting techs and report back anything I find out. Bob

    Thread Starter redtruck

    (@redtruck)

    Hi Class, If you’re not on the other side of the world from me, you’re up awful late. Thanks for such a quick response.

    1. Shell Access. I have shell access through root. But when I tried to setup the MySQL databases through the shell, it rejected my root password and expected a master MySQL password which I don’t have. I’ll request from my host.

    2. “Does db scrubsfi_wp1 exist?” Yes. After the I got the “Error establishing a database connection” I’ve deleted the blog folder, left the databases intact, downloaded ver 1.5.1.3 from this site, uploaded it to my site, edited and renamed the wp-config.php and got the same result. Then I also tried deleted the hosting account, then created the hosting account again, setting up the MySQL databases fresh through the cPanel, uploading 1.5.1.3, editing and renaming wp-config-sample.php and I still get the same result.

    Do you know how I can find the master MySQL password for this server (it is mine, albeit hosted offsite) with root access?

    Do you know if there is any problem to my changing the MySQL password for this server (which I believe I can do through my WebHostingManager access), in which case I would know the password and be able to carry out your shell command. Or would this disrupt other MySQL applications running on this server?

    3. “Do you have access to db and http error logs?” With shell access through root, I’m sure I do but I don’t know what I’m looking at or looking for. I know just enough to be dangerous. But I follow instructions well. Sorry.
    <8^)

    Thanks, Bob

    Thread Starter redtruck

    (@redtruck)

    To podz,
    Many thanks to you for your response as well.
    When I said “then it stopped working” I was referring to the one-click installation through my cPanel. I had to reinstall WP so I deleted the hosting account, then created the hosting account again and attempted the one-click installation process through my cPanel as before. The resulting page says this:
    “WordPress 1.5 Setup
    We are installing in /home/username/public_html/blog…
    Moving installation files into place…Done
    Setting up config file…Done
    Finishing installation steps…Done
    Installation Finished
    To access your WordPress installation go to: https://domain.com/blog/
    To access the admin area of your WordPress installation go to: https://domain.com.com/blog/wp-admin/
    The default randomly generated username and password are:
    Username:
    Password:

    BTW, the actual version installed through this one-click process was 1.5.1.1.
    The exceptions I noted were:
    1. The wp-config.php was not present or setup with database info as reported. An unedited wp-config-sample.php was in the /blog folder but not the correct and complete wp-config.php as before.
    2. The MySQL database, user and password were not setup as before.
    3. No “default randomly generated username and password” was not provided as before.

    I tried creating a new MySQL database with a new user and password, editing this information into the wp-config-sample.php, renaming it to wp-config.php, then running the wp-admin/install.php but this resulted in the same “Error establishing a database connection” message.

    So I deleted the blog folder, downloaded ver 1.5.1.3 from this site, uploaded it to my site, edited and renamed the wp-config.php and got the same result: Error establishing a database connection.

    As I mentioned, I have another application in a different domain on this server where MySQL databases are running just fine. So I believe MySQL is running okay on this server. If there’s some other way for me to test whether MySQL is connecting in this domain, or if I can provide any other info, please let me know.

    Thanks for your help, Bob

    Thread Starter redtruck

    (@redtruck)

    To Class,
    Many thanks for responding.
    I edited the wp-config-sample.php file per the instructions as follows:
    define(‘DB_NAME’, ‘scrubsfi_wp1’);
    define(‘DB_USER’, ‘scrubsfi_wp1’);
    define(‘DB_PASSWORD’, ‘**obscure**’);
    define(‘DB_HOST’, ‘localhost’);
    being careful not to delete any punctuation. I’ve checked the names to be sure they are the same as are indicated in the MySQL section of my cPanel. Then I changed the file name to wp-config.php . It’s permissions are 644.

    If you need access to the cPanel of this hosting account to help further, I can provide access information. I need to know what steps you take to resolve the problem as I have another account to correct.

    Thanks again, Bob

Viewing 5 replies - 1 through 5 (of 5 total)