Forums

Error establishing a database connection at install (11 posts)

  1. seandunderdale
    Member
    Posted 4 years ago #

    Ive been trying to install WP for a few days now but keep having the same problem. I read alot about it on the forums, so contacted my host (ehostpros) about what some suggestions were.

    They provided me with an install script to run from my cPanel that creates a user and a database for me, which clearly means my hosting is compatible.

    So I took that info and entered that into the wp-config several times, checking single quotation marks and spacing. The install also added extra brackets around the text I replaced so I tried it several times with and without the extra brackets but always got the same result.

    I plan to mail my hosting again tonight and have filled out a form for a the "install4free" help, but would still like to work it out. Im no PHP pr MySQL pro but this should be easy.

    I know there are ALOT of threads with this same problem but all the answers seem to be different.

    Im running:

    Linux OS
    PHP: 4.3.11
    MySQL: 4.0.27-standard

    Cheers.

  2. actorjiml
    Member
    Posted 4 years ago #

    You probably did this, but I have to ask. Did you rename the wp-config-sample.php file wp-config.php?

  3. seandunderdale
    Member
    Posted 4 years ago #

    Didnt have to :) . When I run the install script my host provided me, it creates a database, a user, and uploads the WP database to the correct directory, with wp-config/php already renamed.

    Ive been onto phpMyAdmin and it can see the new database that was created by the WP script.

    Im stumped.

  4. actorjiml
    Member
    Posted 4 years ago #

    Just to be clear, your wp-config.php file contains something like this:`define('DB_NAME', 'wordpress'); // The name of the database
    define('DB_USER', 'username'); // Your MySQL username
    define('DB_PASSWORD', 'password'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value`

    And you've changed the values to the ones given to you by your hosting provider, correct?

  5. seandunderdale
    Member
    Posted 4 years ago #

    that is correct. At first I used the install pack I downloaded from the WP web site. That had exactly the same results. Id edit the wp-config.php file with the appropriate info and get an error page.

    Thats why I contacted my host and they gave me the script to run through cPanel.

    Mine looks like:

    <?php

    // ** MySQL settings ** //

    define('DB_NAME', 'myDataBase'); // The name of the database

    define('DB_USER', 'myUsername'); // Your MySQL username

    define('DB_PASSWORD', 'xxxxxxxx'); // ...and password

    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

    define('DB_CHARSET', 'utf8');

    define('DB_COLLATE', '');

  6. actorjiml
    Member
    Posted 4 years ago #

    I just thought of something that has tripped me up on my own sites from time to time. While the name of my database is "wordpress" the real name is "login_wordpress". Same for the user name, it's not just blogadmin, but login_blogadmin. In both cases "login" is actually the username I have for each hosting account. Could ehostpros be doing something similar?

  7. seandunderdale
    Member
    Posted 4 years ago #

    ya, it is. Both the database and the username have my ftp login name in front of the names the script creates. Ive tried with and without aswell just in case.

  8. actorjiml
    Member
    Posted 4 years ago #

    You said you can see the database when you go through phpMyAdmin, so your username and password should be correct. (I am just thinking outloud here). If you go into phpMyAdmin it shows your database. Does it show the server as localhost? And does it show the user as "whatever is in wp-config"@localhost?

  9. seandunderdale
    Member
    Posted 4 years ago #

    yep, it has myUsername@localhost in the database the WP script created.

    It does say "no tables found in database" though which Im not sure about.

  10. seandunderdale
    Member
    Posted 4 years ago #

    k Ive recieved a different error now,

    "ERROR: [% table_prefix %]_ in wp-config.php can only contain numbers, letters, and underscores."

    Thats what I get now when I run the install.php though my browser.

  11. actorjiml
    Member
    Posted 4 years ago #

    What is $table_prefix set to in wp-config.php?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.