Jump to content

PHP - MySQL link not working


varunj

Recommended Posts

Hi all,

Just trying to setup the Apache, PHP, MySQL trio on my computer for the first time, and seem to be facing a problem many people have - the connection between PHP and MySQL.

 

I have got Apache (2.2), PHP (5.3.3) and MySQL (5.1) to work independently.

 

However, when I try to use a test file (mysql_test.php placed in the htdocs folder) to test the connection between PHP and MySQL I get the following error:

 

--

Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 9

 

Warning: mysql_connect() [function.mysql-connect]: 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:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 9

 

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 9

--

 

I have tried everything I could find, including the guide by wildteen88:

 

1. I have removed the semicolon before extension=php_mysql.dll and extension=php_mysqli.dll

2. I have changed the line and removed the semicolon before extension_dir = "C:\php\ext"

3. I have added the file libmySQL.dll file to C:\Windows

4. I have added C:\php to the Windows Path system variable

5. Restarted the computer

6. Restarted the Apache server

 

I have attached my php.ini and mysql_test.php files to this message.

 

Really don't know what else to do. If you need any more info, let me know.

 

Thanks

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.