davidmuir Posted September 27, 2007 Share Posted September 27, 2007 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 More sharing options...
davidmuir Posted September 28, 2007 Author Share Posted September 28, 2007 Does anyone know where I could put this post so I could at least get some answers. Link to comment https://forums.phpfreaks.com/topic/70963-mysql-connection-problem/#findComment-357452 Share on other sites More sharing options...
mattal999 Posted September 28, 2007 Share Posted September 28, 2007 your database can't be located on the root: localhost. It might be sql.yourdomain.com. It depends where and how u installed it... Link to comment https://forums.phpfreaks.com/topic/70963-mysql-connection-problem/#findComment-357496 Share on other sites More sharing options...
BlueSkyIS Posted September 28, 2007 Share Posted September 28, 2007 ^^^ What?? My local MySQL is root@localhost. I better tell it to stop working. ??? Link to comment https://forums.phpfreaks.com/topic/70963-mysql-connection-problem/#findComment-357509 Share on other sites More sharing options...
mattal999 Posted September 29, 2007 Share Posted September 29, 2007 im sorry, i dont know whats wrong. maybe you should try a complete reinstall? Link to comment https://forums.phpfreaks.com/topic/70963-mysql-connection-problem/#findComment-357858 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.