WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error establishing a database connection (17 posts)

  1. yogiwan
    Member
    Posted 5 years ago #

    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 http://sitename.com/wp-admin/install.php I now get the above error - error establishing a database connection.

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

  2. 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).

  3. ynk
    Member
    Posted 5 years ago #

    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.

  4. JanDanger
    Member
    Posted 5 years ago #

    Yeah, I have the exact same problem.

  5. MichaelH
    Member
    Posted 5 years ago #

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

  6. yogiwan
    Member
    Posted 5 years ago #

    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.

  7. Samuel B
    moderator
    Posted 5 years ago #

    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:

    /public_html
      index.php
      wp-config.php
      other files in root of folder
                    /wp-admin
                         /all of files and folders that go with it
                     /wp-content
                                /themes
                                      /sem-pro
                                       sem-pro files and folders
                      /wp-includes
                        all files and folders

    keep this structure

  8. ynk
    Member
    Posted 5 years ago #

    samboll you need to help a novice here. The only thing I know about this is follow the 'readme folde'. i am using christianwebhost.com 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

  9. Samuel B
    moderator
    Posted 5 years ago #

    @ 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 http://www.mydomain.com
    - 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:
    http://codex.wordpress.org/Using_cPanel

  10. anton61
    Member
    Posted 5 years ago #

    Hi,
    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.
    http://www.7-zip.org/ and it all worked for me..
    hope that helps.
    Regards
    Tony

  11. ynk
    Member
    Posted 5 years ago #

    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.

  12. ynk
    Member
    Posted 5 years ago #

    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.

  13. Samuel B
    moderator
    Posted 5 years ago #

    you can NOT use front page - you must use an FTP client
    http://filezilla-project.org/download.php
    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.

  14. brandieg
    Member
    Posted 5 years ago #

    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?

  15. Samuel B
    moderator
    Posted 5 years ago #

    @brandieg
    please start a new thread - this one is confusing enough

  16. ynk
    Member
    Posted 5 years ago #

    Samboll,
    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="http://i.cdn.turner.com/cnn/.element/js/2.0/video/evp/module.js?loc=dom&vid=/video/politics/2008/11/05/sot.obama.entire.cnn" type="text/javascript"></script><noscript>Embedded video from CNN Video</noscript>

    can you please help me out? thanks.

  17. MichaelH
    Member
    Posted 5 years ago #

    ynk -- that is a subject for another topic.

Topic Closed

This topic has been closed to new replies.

About this Topic