EasyPHP
EN FR
>download >components >modules >blog >forum >faq >screenshots >introduction

For Windows Vista/Seven issues, please read the FAQ or leave a detailed message
-->

upgrade fra EasyPHP 1.8 to 5.3.2i cannot connect to MYSQL



Posted by: weimbos
July 20, 2010 04:04PM
Earlier I have been running on a EasyPHP 1.8. Now I have installed EasyPHP 5.3.2i in another folder. Then I have created at database and restore the data from EasyPHP 1.8. I am using the exact programs, but got an error, Warning: mysql_connect() [function.mysql-connect]: [2002] Et forbindelsesforsøg mislykkedes, fordi den, der tilsluttede, i (trying to connect via tcp://localhost:3306) in ....

I have look in both FAQ and this forum, and tried a lot to get it to work, but I still get the error. Most of the aswers says change localhost to 127.0.0.1, mI still get the error. i am running windows Vista and explorer 8. Still when I start EasyPHP 1.8 it works ok.

Please help.

Regards Birte

Posted by: Amour
July 20, 2010 05:37PM
You can't replace MySQL files, it's better to export all databases with phpMyAdmin, and import into new install (don't export mysql database, but yours yes).

Also, you will create your mysql users again ;)

Posted by: weimbos
July 20, 2010 07:25PM
Hello again - that is what I have done, I have not replaced MYSQL files, but export and imported the data - and created mysql user again.

Furthermore I can se I have misplaced the question - it should have been in EasyPHP 5.3.2i instead - how can I move the question?

Posted by: Amour
July 20, 2010 08:14PM
We can continue here, maybe an admin will move it ;)

With default root user, phpMyAdmin is working ?
If yes, can you try root user with your scripts ?

Posted by: weimbos
July 20, 2010 09:48PM
Yes phpMyAdmin works okay with root user.

I have tried: $link = mysql_connect("localhost", "root","") or die("Kunne ikke forbinde : " . mysql_error());

and

$link = mysql_connect("localhost", "root") or die("Kunne ikke forbinde : " . mysql_error());

same result: Warning: mysql_connect() [function.mysql-connect]: [2002] Et forsøg på at oprette forbindelse mislykkedes, fordi den part, (trying to connect via tcp://localhost:3306) in ....

here below I have copied users:

Bruger Vært Kodeord Globale privilegier 1 Tildel Handling
korthaarklubben localhost Ja ALL PRIVILEGES Ja
root localhost Nej ALL PRIVILEGES Ja
Afmærk alt / Fjern alle mærker


As you maybe have noticed I am from Denmark, and som of the text are on danish, I hope you understand it anyway :-)

Posted by: Amour
July 20, 2010 11:23PM
If I understand, mysql connection is refused ? or access denied ?

Can you try to replace "localhost" by "127.0.0.1", and if it is not enough, can you try as root password : "mysql" ?

I hope it will help you...

Posted by: weimbos
July 23, 2010 03:51PM
I found a solution in the php net manual. I have copied it in here, maybe it would help other users to spend less time on it. Thank you for the answers, it helped me to find the solution:

[dk.php.net]:

Bruce Kirkpatrick
28-Oct-2009 05:48
On Windows Vista or above, an entry in the Windows/System32/drivers/etc/hosts file causes mysql_connect() connections to "localhost" to timeout and never connect. This happens on php 5.3 and above since it now uses mysql native driver which has changed it connection behavior compared to libmysql.dll in previous versions. It is not a PHP bug, but definitely a configuration issue for users on new windows systems.

To get around this, you must remove the entry like this:
::1 localhost

and make sure you still have:
127.0.0.1 localhost

Also, you could change the code to connect to the ip instead, but that is inconvenient if you have many web sites.

This issue occurs on Windows Vista, Windows 7 and Windows Server 2008.

Posted by: umitaygun
August 19, 2010 09:27AM
Hello, thanks

Re: upgrade fra EasyPHP 1.8 to 5.3.2i cannot connect to MYSQL