Question: I've installed XAMPP on my Windows XP. I started the XAMPP control panel and it shows apache and mysql are running.

When I check the status by going to `localhost/xampp` it shows:

```
mysql : deactivated

```

When I run php files that access the mysql database, it shows the following errors:

```
Warning: mysql_connect() [function.mysql-connect]: [2002] No connection could 
be made because the target machine actively refused it. (trying to connect 
via tcp://localhost:3306) in C:\xampp\htdocs\Elo_algorithm.php on 
line 18

```

I've been through the XAMPP troubleshooting page and FAQ but I don't understand what to do. The XAMPP control panel shows mysql is running, but xampp status shows: `deactivated`.

What is going on here?

Answer: 
You should view in the xampp installation the file "\xampp\mysql\data\mysql\_error.log".

This file contais the error log of MySQL and in it you can detect any problem like por in use.

For example, this lines of log show that the port 3306 (the mysql default) is used by another application and can't be accessed.

```
111130  8:39:56 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
111130  8:39:56 [ERROR] Do you already have another mysqld server running on port: 3306 ?
111130  8:39:56 [ERROR] Aborting

```

If all in the MySQL is correct probably the problem is related to the driver in the php application. Currently PHP has two MySQL connector types, the "mysql" and the "mysqli", MySQL "mysql" connector, that use "**mysql\_**" (the method that you are using to connect is mysql\_connect) prefixed functions, is used for old MySQL 4 applications and when the MySQL 5.x if is in configured with the "old password" parameter. The "mysqli" is used for the new mysql 5.x versions and in php you must use "**mysqli\_**" prefixed functions like "mysqli\_connect. 

The version used by the lastest versions of xampp is MySQL 5.5 and you require to used the mysqli connector.
i was facing the same problem. I had to run setup-xampp.bat to make it working.
By the way I came across a new WAMP stack called AMPPS. It looks quite easier than XAMP. You should try. <http://www.ampps.com>