Page 1 of 1

[SOLVED] Can' t connect to MySQL server

Posted: Wed Apr 18, 2007 5:13 am
by Rovas
Hy,
I have installed, using the installer, the latest stable version of PHP and MySQL for MS Win XP with IIS as server. I followed the instructions for enabling the PHP extension for MySQL. Using

Code: Select all

php_info();
mysql and mysqli extension are recognized as enabled.
I tried to connect using the PHP to a database that I made but I received the warning that it can' t connect to the MySQL server. I' ve checked and checked and I can' t figure where is the mistake in configuration: I went over th php.ini file again: path to extension folder is good in the configuration of IIS the php scripts are good, the dll have been dowloaded from mysql.com and they are put in the right folders (System32 and ext in the PHP' s folder), the php script is correct.
Any ideas ?

Posted: Wed Apr 18, 2007 5:23 am
by Oren
Sounds like your login info is incorrect. What does mysql_error() tell you?

Posted: Wed Apr 18, 2007 5:44 am
by Rovas
The login information; the username, the password and the address are correct.

Code: Select all

Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can't connect to MySQL server on 'localhost' (10061) in 
D:\Work\site\db_class.php on line 37

Posted: Wed Apr 18, 2007 8:42 am
by volka
Looks like there's no mysql server running on that computer.

Posted: Wed Apr 18, 2007 8:54 am
by Chris Corbyn
Agreed. What do you get if you open a Console window and type "mysql" ?

Posted: Thu Apr 19, 2007 2:50 am
by Rovas
It is running if it wasn' t running I couldn' t create the database (I create first then I run the php script), it appears as running in the list of process of Task Manager. I restarted the service, the server, and the computer after each change I made.

Posted: Thu Apr 19, 2007 3:08 am
by Rovas
I solved it: iit was the wrong port number selected in the MySQL server. Thanks for your posts.