Tell me about your local server environment.
It is a specific server that they are using for an intranet.
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
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.ww.wp.xz.cn/Installing_WordPress_Locally_on_Your_Mac_With_MAMP
Would it be that I am now using a windows instead of a mac and I need to use WAMP?
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.
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.
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 9 years, 6 months ago by
James Huff.
-
This reply was modified 9 years, 6 months ago by
bdbrown.
-
This reply was modified 9 years, 6 months ago by
bdbrown.
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.
Mysql host is also localhost.
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