introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.

Go to Topic: PreviousNext
Go to: Message ListNew TopicSearchLog InPrint View

mysql error



Posted by: suryakanta
January 23, 2011 09:14PM
Hello sir,
I am using the following command in my php scripts.

$connect = mysql_connect("localhost","root","");

But during execution I am getting an error as

Warning: mysql_pconnect() [function.mysql-pconnect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Users\Dell\Documents\testing server\mysql\connect.php on line 10

Warning: mysql_pconnect() [function.mysql-pconnect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Users\Dell\Documents\testing server\mysql\connect.php on line 10

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Users\Dell\Documents\testing server\mysql\connect.php on line 10


Please give me the solutions to this..

with regards
suryakanta
Options: ReplyQuote
Posted by: Thierry
January 24, 2011 02:21AM
use 127.0.0.1 instead of localhost
Options: ReplyQuote
Posted by: Amour
January 24, 2011 09:20AM
You can also edit your hosts Windows file to use localhost ;)
Options: ReplyQuote
Posted by: suryakanta
January 24, 2011 04:55PM
Thanks for the response sir/madam...

But this could not fix the problem. Even I tried putting "127.0.0.1".
It did not work at all... And in the system32\drivers\etc\host file the host "localhost" is alredy been added and ip is "127.0.0.1".

I am using a 64-bit win7 system. The status of EasyPhp is green. I mean its working fine. But the statement I mentioned before is not being executed.

Would you suggest some more solutions to this????
Options: ReplyQuote
Posted by: Amour
January 24, 2011 07:44PM
Can you try to start EasyPHP as Administrator, or without Windows UAC, or run servers as Service ?
Options: ReplyQuote
Posted by: suryakanta
January 25, 2011 07:19PM
sir
I am always starting my EasyPhp as admin. But how to run servers as services. I could not got it through.
Options: ReplyQuote
Posted by: Amour
January 25, 2011 07:45PM
Right click onto systray icon --> Configuration --> EasyPHP --> check "Start Apache and MySql as services".

Maybe it will be better ?
Options: ReplyQuote
Posted by: suryakanta
January 26, 2011 09:07AM
Thanks for the response.

But doing this I am getting mysql error message showing that "can not run the server: The specified service does not exist as installed service(1060)".
Options: ReplyQuote
Posted by: Amour
January 26, 2011 10:07AM
If you check + Apply, or uncheck + Apply and after check + Apply, it's not better ?
Options: ReplyQuote
Posted by: suryakanta
January 26, 2011 10:37AM
yes sir... after check+apply it's showing the error at startup of EasyPhp. And now I have upgraded the version to 5.3.5.0. But the problem is not fixed. And also by opening PhpMyadmin it's showing some error as

Welcome to phpMyAdmin

Error
MySQL said:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
Options: ReplyQuote
Posted by: Amour
January 26, 2011 03:00PM
I tested with Windows 7 x64 : it's OK.

Please, can you try without Windows 7 UAC, for testing purposes ?
Options: ReplyQuote
Posted by: suryakanta
January 27, 2011 01:05PM
no sir..
I have disabled the windows 7 uac. Its not working. Do I need any changes in configuration file? My EasyPhp port is 8888. username is "root". MySql uses a default port 3306 and MySql host is "127.0.0.1". Do I need to add "mysqld" as services?
Or I have to made changes in the "host" file? Because it has a port "1" and hostname as "localhost". Please give me any other suggestions.
Regards
Suryakanta
Options: ReplyQuote
Posted by: Amour
January 28, 2011 07:02PM
With TCPView or equivalent, do you see MySQL listening TCP 3306 port ?

Sincerely, I don't understand...
Options: ReplyQuote
Posted by: suryakanta
January 29, 2011 08:56AM
yes sir its 3306 only.But should I change anything in the host file or services file. There might be other programs using the same port and interrupting EasyPhp. By surfing on the net I could see people saying to bring changes in the host file. But it did not work at all. My host file has two statements something like
# 127.0.0.1 localhost
# ::1 localhost
Do I need this to change? Or I need to add "mysqld" into the services file.
Please help me sir. I need to have it perfect soon.
Options: ReplyQuote
Posted by: Amour
January 29, 2011 08:59AM
To be sure it's not hosts file, you can do that :

Replace : # 127.0.0.1 localhost
By : 127.0.0.1 localhost

(remove the #)

After, restart your computer and try again ;)
Options: ReplyQuote
Posted by: suryakanta
January 29, 2011 09:59AM
No sir It really did not work. I tried it twice. Any other suggestions sir??
Options: ReplyQuote
Posted by: suryakanta
January 29, 2011 10:01AM
Sir After changing that I am getting an error during the startup of EasyPhp as "Can not retrieve hash from the web".
Options: ReplyQuote
Posted by: Thierry
January 29, 2011 10:06AM
Nothing to do with your problem.

Another time: use 127.0.0.1 in mysql hosts in your scripts.
Options: ReplyQuote
Posted by: suryakanta
January 29, 2011 10:09AM
Sir I am using the same you told. But then also its not working. The apache log file shows

[Sat Jan 29 14:57:35 2011] [error] [client 127.0.0.1] PHP 3. mysql_connect('127.0.0.1', 'root', '') C:\\Users\\Dell\\Documents\\testing server\\mysql\\connect.php:10, referer: [127.0.0.1]

regards
suryakanta
Options: ReplyQuote


Go to: Message ListSearchLog In
Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.