Support » Installing WordPress » Error establishing a database connection

  • Resolved yogiwan


    I used Fantastico to installl WP and could get to the content. I then downloaded Semiologic Pro and used Filezilla to move the files to public.ftp. I then changed the DB Name, DB User DB password and added the secret key.

    Going to I now get the above error – error establishing a database connection.

    I have no idea of where to look next to resolve this problem.

Viewing 15 replies - 1 through 15 (of 16 total)
  • If you used Fantastico, then it should have set up the files and database and sent you an email with the db information to put in your wp-config file (or maybe it sets it up all on it’s own, it’s been a while since I used it).

    i have the same problem it says
    “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?
    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.”

    Everything is set correct and my server is running. Please what else can I do? I am not a computer wiz and I dont know how to run query. Somebody help.

    Yeah, I have the exact same problem.

    @yogiwan – you should not have changed the DB_NAME, DB_USER, and DB_PASSWORD values in your wp-config.php file. I would consider deleting the Fantastico install and either do the Fantastico install again, or install WordPress according to the Installing WordPress instructions.

    @ynk and JanDanger – almost always the “Error establishing a database connection” is either a result of a wrong value in your wp-config.php file or the database server is down.

    MichaelH — I changed the values in the wp-config.php file because they were “example – change the value” fields. And I changed the values to my URL, user name, and password. I have validated this several times that they are correct.

    The information here is consistent with what I thought was the problem. The things that need to be checked are the server name and the valid content in the fields mentioned above. Does it make a difference in which folder wp-cofig file is? public_ftp, sem-pro, wp-content, wp-includes, or www wp-admin is currently contained in public_html, sem-pro and www and the wp-config.php is in public-ftp, sem-pro, and www.

    wow – you are really confused
    public_ftp is only for allowing people with a password to upload files to your server.
    This is how your structure should look:

      other files in root of folder
                         /all of files and folders that go with it
                                       sem-pro files and folders
                        all files and folders

    keep this structure

    samboll you need to help a novice here. The only thing I know about this is follow the ‘readme folde’. i am using on their control panel is msql which leads me to my existing database. I created a new database with user ID and Password. The same information is used to update wp-config php file. Serve is on, ID are correct but I could still not install all gimick required. Please help and speak a novice language. Thanks

    @ ynk
    if I remember correctly they use a cpanel?
    the always prepend with the 1st eight letters of your domain
    so if your domain was
    – info for db would be similar to:

    // ** MySQL settings ** //
    define('DB_NAME', 'mydomain_databasenameicreated');    // The name of the database
    define('DB_USER', 'mydomain_usericreated');     // Your MySQL username
    define('DB_PASSWORD', 'passwordicreated'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    a rookie mistake , also, is to forget to add user to the database.

    There is also an excellent cpanel howto here:

    Dont know if this helps, but I was getting the same
    “error estabishing database” thingy.
    I am a total newbie to all this stuff, but,I “eventually!” noticed that the wp-admin and wp-content files didnt exist in my unzipped wordpress folder.
    for some reason,the extract program ‘cam/unzip’ left them out, and the windows vista extractor locks up when I try that. So I tried 7-zip from here. and it all worked for me..
    hope that helps.

    Honestly trying hours without real result is killing! can someone from wordpress help me install this? I spend hours following every instructions without any result. If this will just take 5 minutes according to wordpress, then i think someone need to help me pleeeease. my host use cpanel.

    this thing is not working out. i spent hours on this without any result. can someone from wordpress please help me install correct this file and if possible guilde or install for me. I use mocrosoft frontpage.

    you can NOT use front page – you must use an FTP client
    try again – if you don’t get it, click on my name and use contact form on my site. I’ll help late this afternoon.

    I too am getting the “Error esttablishing database onnection” message.
    I have successfully set up phpMyAdmin in a phpMyAdmin subdirectory of my root www direstory. I uploaded the unzipped WordPress files to that root directory. The other subdirectory established for mysql is www-data.

    The working phpMyAdmin config file has the following $cfg[‘Servers’][$i] commands:
    [‘host’] = ‘localhost’;
    [extension’] = ‘mysql’;
    [‘port’] = ‘3365’;
    [‘socket’] = ‘/home/users/…/www-data/tmp/mysql.sock’;
    [‘connect_type’] = ‘socket’;
    [‘compress’] = false;
    [‘auth_type’] = ‘config’;
    [‘user’] = ‘root’;
    [‘password’] = ‘myPW’;

    I used phpMyAdmin to create a WordPress database and it created an empty WordPress subdirectory under www-data.

    In my wp-config file I specified
    ‘DB_NAME’, ‘WordPress’
    ‘DB_USER’, ‘root’
    ‘DB_PASSWORD’, ‘myPW’
    ‘DB_HOST’, ‘localhost:3365’

    What else do I need to get WP to talk to mysql?

    please start a new thread – this one is confusing enough

    Thanks. someone from my host helped me out and site is running. However, i’ll like to know if i can place vidoe and pictures on my blog page. I got something on cnn and they provided html to place on blog but i just dont know how: what cnn provided is:
    <script src=”” type=”text/javascript”></script><noscript>Embedded video from CNN Video</noscript>

    can you please help me out? thanks.

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