Error establishing a database connection
Posted by: mbaghy (2.191.93.---)
Date: May 01, 2015 06:07PM

Hi
first of all i should answer 12 questions so :

1 - Windows version used : win 7 ultimate 32 bit

2 - Version WampServer : 2.5 32 bit
3 - Apache Version : 2.4.9
4 - PHP Version: 5.5.12
5 - MySQL Version : 5.6.17
6 - color of the WampServer icon : Green

7 - In the file c:\Windows\System32\drivers\etc\hosts, non of them are active and first of all lines is #

8 - Do you have access to localhost (Homepage WampServer)? Yes

9 - Do you have access to phpMyAdmin? Yes

10 - If you refer to an error message, please include the EXACT wording of the error in your post

11 - I use ESET smart security 8 32 bit
12 - What is the full path to the installation of WampServer : C:\wamp\




So now my problem :
i want to install wordpress 4.2.1 but when i go to localhost\wordpress , this error appears


" Error establishing a database connection "

i should mention that i have followed this instructions step by step

[make.wordpress.org]

Options: ReplyQuote
Re: Error establishing a database connection
Posted by: RiggsFolly (---.as43234.net)
Date: May 02, 2015 03:18PM

Then you have not followed Step 2 of [make.wordpress.org] correctly.

Its normally to do with setting these parameters DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST correctly

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Error establishing a database connection
Posted by: mbaghy (128.199.96.---)
Date: May 02, 2015 05:25PM

Thanks for your answer but believe me that I've checked it several times it is ok.first i changed the name of file then user name,pass and host (localhost).
But don't you think that the problem is in host file of window that I mentioned in number 7?? Should I do something on this file? ?

Options: ReplyQuote
Re: Error establishing a database connection
Posted by: RiggsFolly (---.as43234.net)
Date: May 02, 2015 09:08PM

Well yes now you mention it.


HOSTS file should have at least


127.0.0.1  localhost

::1   localhost

But that will not have any effect on PHP code connection to a MySQL database

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Error establishing a database connection
Posted by: mbaghy (2.191.69.---)
Date: May 02, 2015 11:33PM

thank you RiggsFolly about your answers.

my problem is now solved with reinstalling wamp server. finally i didnt know what was my problem ??? sad smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.