• Resolved loeppkydesigns

    (@loeppkydesigns)


    Hello.
    I am working off a local server and I keep getting the message Error Establishing a Database Connection. I know that my password and user name is correct. I have done this before on a different local server, but this time it is not working for me. Any tips on what I can try? Thank you very much.

Viewing 15 replies - 1 through 15 (of 35 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Tell me about your local server environment.

    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    It is a specific server that they are using for an intranet.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Well that’s incredibly not useful.

    Is the database server on the same server that’s hosting the website?
    Is it MySQL?
    Do you have all the necessary PHP libraries installed?

    If you enter exactly the same stuff from the wp-config.php file on the command line, can you connect?

    mysql -u db_user -pdb_password -h db_host db_name

    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    Sorry I apologize. I am new to this so you might have to bare with me.
    I am using MAMP to host the website.
    I have done this before and it worked awesome.
    I followed these directions to the T both times: https://codex.www.ads-software.com/Installing_WordPress_Locally_on_Your_Mac_With_MAMP

    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    Would it be that I am now using a windows instead of a mac and I need to use WAMP?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I will “bear” with your but not “bare”. ??

    The MAMP docs indicate that it will work on Windows. I recommend you do some googling about MAMP, Windows, and database connections.

    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    Thanks. I have done lots that is why I was trying to ask. Thank you. i will keep trying

    May be it is due to config settings .
    Open your wordpress folder and edit wp-config.php and update the following .

    /** MySQL database name */
    define(‘DB_NAME’,’your datbase name’);
    /** MySQL database username */
    define(‘DB_USER’,’username’);

    /** MySQL database password */
    define(‘DB_PASSWORD’,’password’);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    Thanks

    You should search for wp-config file and double check the database name and the password also.

    Indexed

    (@peter_indexed)

    Make sure that you mysql host is localhost or 127.0.0.1

    Often you will notice this Error establishing database connection when your site gets swarmed with a lot of traffic. Basically, your host server just cannot handle the load (specially when you are on shared hosting). Your site will get really slow and for some users even output the error. So the best thing you should do is get on the phone or livechat with your hosting provider and ask them if your MySQL server is responsive.

    Ethan Stark
    [Signature removed by moderator per forum rules.]

    • This reply was modified 8 years, 3 months ago by James Huff.
    • This reply was modified 8 years, 3 months ago by bdbrown.
    • This reply was modified 8 years, 3 months ago by bdbrown.
    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    I checked the settings in the wp-config file and the database name, username and password is all correct.
    Also I am not sure if traffic is the case. I am only trying to set up and download wordpress.

    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    Mysql host is also localhost.

    Thread Starter loeppkydesigns

    (@loeppkydesigns)

    My wp-config file does say -sample behind the name. Could that be the problem?

    @loeppkydesigns

    If you are using the latest MAMP for Windows (3.2.2 – 2016-08-19) and are using the default settings, then your database connection details are:

    Database Name: whatever you named it when you created it by accessing phpMyAdmin from the MAMP Start Page > Tools menu

    Database User: root

    Database Password: root

    Database Host: localhost

    Cheers!
    Lyle

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Error Establishing a Database Connection on Local Server’ is closed to new replies.