Jump to content

mySQL Connection Problem


davidmuir

Recommended Posts

Hello,

 

I recently setup mySQL and PHP on my Windows Small Business Server 2003 Server at my company. I have been wanting to write some php scripts to interact with a database on the server but have been unable to connect to the database via PHP. A simple connect function:

 

mysql_connect("localhost","root","*******");

 

Yields the error:

Can't connect to MySQL server on 'localhost' (10061)

 

The strange thing is, that I was able to connect with phpmyadmin just fine in "config" mode. Where it makes you enter your username and password.

 

Also I can easily connect via the command line on the server through the command mysql -u root -p.

 

I have read that this could possibly be a port issue of some sort. But when I do a phpinfo() on the server it says that the default port is 3306. There is no firewall running on the server. Please let me know if you need any more information.

 

I would appreciate any help greatly as I have been working on this problem for several days now.

Link to comment
https://forums.phpfreaks.com/topic/70963-mysql-connection-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.