[SOLVED] Can' t connect to MySQL server

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

[SOLVED] Can' t connect to MySQL server

Post 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 ?
Last edited by Rovas on Thu Apr 19, 2007 3:05 am, edited 1 time in total.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Sounds like your login info is incorrect. What does mysql_error() tell you?
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Looks like there's no mysql server running on that computer.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Agreed. What do you get if you open a Console window and type "mysql" ?
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post 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.
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

I solved it: iit was the wrong port number selected in the MySQL server. Thanks for your posts.
Post Reply