Contact Information
+27 11 674 1174

Web Design

We specialize in Joomla! web design, custom templates and Joomla! hosting.  Toxzen also develop custom data driven PHP web applications.

Web Hosting

Affordable Web Hosting services, domain registration and email.  Our business Web Hosting packages are perfect for your growing business.

Cannot connect to MySQL from PHP on IIS

Rate this item
(0 votes)

While developing my Joomla sites I've recently experienced some difficulty connecting to MySQL with PHP.  The solution is rather simple and I'm sure there's a very good explanation that I need to understand (Likely to follow in another tutorial).

What is the problem?
First of all my configuration is this:  I'm developing on a Windows 7 machine running IIS and PHP installed (using FastCGI - It works great!).  I am using PHP 5.3.  I am also running XAMPP for mysql as I don't like to install to many database systems on my PC and XAMPP is portable - you just turn it on when you need it.

I Often take snapshots of my sites in order to work on them.  I do this using Akeeba backup for Joomla and then download the file.  I run the kickstart.php page to then install the site locally.  When it gets to the database information, no matter what I try with the standard settings it fails to connect to MySQL.  My local sites also have recently failed to connect to MySQL.  Through all this I have not changed any of MySQL's settings.  XAMPP can also connect perfectly fine.  So the change must lie with IIS or PHP which have both been recently updated.

What is the solution?
When asked for the host, during the Akeeba install or any connection prompt for that matter, most people use "localhost".  I have for years.  However this fails.  You need to use your localhost BUT type the IP address in its place: 127.0.0.1

Additional Info

  • Software: PHP, Joomla, IIS MySQL
  • NOTE: This failure to connect is a recent problem related to new versions of IIS and PHP
0 subscriber

Comment subscription

Receive email notification when a new comment is added to this item.

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.