Portal Home > Knowledgebase > Articles Database > MySQL on Nginx problem


MySQL on Nginx problem




Posted by ScopeXL, 11-11-2010, 09:48 PM
Hello, I seem to have run into a roadblock concerning my installation of nginx + php + mysql and am seeking help/advice. Basically, I have nginx and php 5 configured and running on a Windows 32bit platform. I installed MySQL Community Server 5.1 as a windows service, and can access mysql commands and databases through its command line client. What I can't do, is get php to connect to MySQL, the script simply times out everytime. Nginx spits out "The page you are looking for is temporarily unavailable. Please try again later." only when attempting a MySQL connection. I have looked at php.ini and the php_mysql.dll is loaded, I run php-cgi standalone with no errors, it simply won't connect. I have my firewall completely off, as well as port forwarding "3306" to the target machine running MySQL. I am completely out of ideas as to why this is happening, any insight would be greatly appreciated. Thank you.

Posted by Ronald_Craft, 11-12-2010, 12:15 AM
Is there some certain reason you're attempting to run nginx on Windows? They even state on the official nginx site that it's in beta, only the select method is supported (so you won't get the same performance as a *nix environment) and there are several issues (such as only 1 worker working and not being able to accept more then 1024 connections). Honestly, I'd just use IIS. There's too many issues with nginx on Windows to make it practical right now.

Posted by Steven, 11-12-2010, 12:55 AM
IIS on windows actually performs quite well - i'd stick with it.

Posted by Syslint, 11-12-2010, 01:10 AM
If you really need nginx performance . Then you need to go to Linux server .

Posted by tim2718281, 11-12-2010, 01:41 AM
Can you show the mysql_connect code that's timing out, and also how you connect using the MySql command line client? There are some oddities in newer versions of Windows to do with using localhost.

Posted by ethakota, 11-12-2010, 11:28 AM
I am getting sql exception error while trying to execute a code of my project can anyone help from this

Posted by ScopeXL, 11-13-2010, 12:28 AM
I have switched from Nginx to IIS and installed PHP 5.3.3 and MySQL Server 5.1. Now when attempting to connect to MySQL it times out on me as well. I upgraded php from the standard installation due to it not being compatible with MySQL server 5.1, now it won't connect at all to SQL, simply times the script out.

Posted by Full Spectrum, 11-13-2010, 02:01 AM
I hate to say this, but I suspect that all ScopeXl's problems are due to mis-configurations of the windows environment. In my opinion configuring windows is far more opaque, fragile and difficult than linux or other unix derivatives.

Posted by tim2718281, 11-13-2010, 08:09 AM
It could be the Windows Defender/localhost problem in Windows. If it is, the OP needs to add the line to the hosts file: 127.0.0.1 localhost

Posted by ScopeXL, 11-14-2010, 09:52 PM
I have fixed this issue by switching to linux. Topic solved. Thank you all for your help.

Posted by Ronald_Craft, 11-14-2010, 10:06 PM
Good call.

Posted by CoderJosh, 11-19-2010, 02:27 AM
That seems to help in many cases.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read