[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 801
  • Last Modified:

phpMyAdmin Configuration on IIS6

Hi,

This is my first quesiton to Experts.  I have an envirionment consisting of an Ubuntu server running mySQL 5.0.22 and two IIS 6 servers.  I have successfully connected to the database using asp and have installed PHP and run phptest.php which works.  I have then run testmysql.php which also produced a connection.  I then installed phpMyAdmin but cannot get the config.inc.php file to connect.  I get a '#2003 - The server is not responding' code back.

I don't think I understand the different users in the login screen and the config file when compared to a connect string:

$rst = @mysql_connect("172.20.0.2","dbuser","dbpassword");

I hope someone can help, the documentation is confusing.  My config file is:

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 3.2.4 setup script by Piotr Przybylski <piotrprz@gmail.com>
 * Date: Mon, 04 Jan 2010 23:12:47 +0000
 */

/* Servers configuration */
$i = 0;

/* Server: 172.20.0.2 [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = '172.20.0.2';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>

Thanks

Emincote
0
emincote
Asked:
emincote
  • 7
  • 5
4 Solutions
 
Mike_CarrollCommented:
Not sure if I follow exactly what you mean but I'll give it a shot...

You need to modify the following lines in the config file to match a MySQL user with suitable permissions... it's not that much different to your connect string... it just looks different

$cfg['Servers'][$i]['user'] = 'dbuser';
$cfg['Servers'][$i]['password'] = 'dbpassword';


0
 
emincoteAuthor Commented:
Thanks Mike,

So what do I need to enter into the login page http://ws1/phpMyAdmin/index.php.  Is there another user and password that I should be using?  If I try the same as the dbuser I get the server not responding message.

Hope this clarifies.  I have now tried your suggestion.

Kind regards

Emincote
0
 
Mike_CarrollCommented:
I'm not entirely sure I understand the type of configuration you need.

If you change the auth_type to config, you'll get an automatic login without the username and password because they are stored in the config file. If you leave it at http, you can remove the dbuser and dbpassword from the config file and enter them each time you connect. You can decide what way you would like it to work.

You also need to add the permissions for the user to allow that user to log in from whatever machine (or host) they need access from. If the permissions are not correct, the mysql server will refuse the connection.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
emincoteAuthor Commented:
Hi Mike,

Thanks for your persisitence.  That explains a lot, but regrettably didn't fix the problem.

The user has all possible privaleges on the mySQL server and I have another application (the asp one) that uses the same user name and password.  I am therefore still getting this '#2003 - server not responding' error.  I also can't get mcrypt to work, could that be causing the problem?  I have tried copying libmcrypt.dll into the system directory and adding it to php.ini, but the login screen still says cannot configure mcrypt.  I have attached the login screen as an image.

Kind regards

Emincote


phpmyadmin-login.gif
0
 
Mike_CarrollCommented:
When you say you have copied libmcrypt.dll into the system directory, do you mean c:\windows\system32 ?

If you run a phpinfo(); is mcrypt showing?
0
 
emincoteAuthor Commented:
Good afternoon and thanks for picking this up.  Yes, I have copied it into c:\windows\system32 and added the lines

[mcrypt]
extension=libmcrypt.dll

into php.ini

I have recopied the install of phpmyadmin and am getting a different problem now.  I am using the very simplified config but am being prompted with a windows security login.  It seems that the application is trying to log me into the IIS server first rather than the mySQL server.  I obviously am still not getting the config correct.

Here it is:

<?php
// use here a value of your choice (maximum 46 characters):
$cfg['blowfish_secret'] = 'a8b7c6d';    

$i = 0;
$i++;

// 'cookie' (or 'http' , especially if mcrypt could not be loaded,
// but cookie giving more meaningful error messages in the testing phase)
// older PHP versions had some problems with "cookie" on 64 bit boxes though
$cfg['Servers'][$i]['host'] = '172.20.0.2';
$cfg['Servers'][$i]['auth_type'] = 'http';

// PHP 5 support for new MySQL 4.1.3+ features:
$cfg['Servers'][$i]['extension'] = 'mysql';

// if you insist on "root" having no password, pma3 needs:
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
?>

Many many thanks for your patience,

Emincote
0
 
Mike_CarrollCommented:
Are you absolutely certain that you have the right mcrypt version for your version of PHP? This is critical.
0
 
emincoteAuthor Commented:
I think that part of the problem is that I used the MS Web Platform Installer which does not include mcrypt.  I have found it in the full install and have tried using the msi instead, but am probably missing something because I then can't get fastCGI to work correctly.

Do you recommend sticking with the Web Platform Installer or the PHP msi?  They seem to present differnt problems.

More thanks Mike,

Kind regards

Emincote
0
 
emincoteAuthor Commented:
Hi Mike,

Hope you might be able to have some more thoughts and many thanks for encouraging me to keep going.

Slowly some progress, I have now managed to correctly configure php and am getting no errors.  I used the msi from php.net and was very careful with the configuration.  I am now encounting a problem that despite entering the following:

$cfg['Servers'][$i]['host'] = '172.20.0.2';
$cfg['Servers'][$i]['auth_type'] = 'cookie';

// PHP 5 support for new MySQL 4.1.3+ features:
$cfg['Servers'][$i]['extension'] = 'mysqli';

in config.inc.php

I get a new error which has me attempting to connect to the web server rather than the remote server.

#1045 - Access denied for user 'bedezftp'@'172.20.0.11' (using password: YES)

Any thoughts,

Emincote
0
 
Mike_CarrollCommented:
This is a user permissions problem.  MySQL gives access based on the username, password and where the user is connecting from. The reason you're getting the error is that MySQL is not expecting the connection from 172.20.0.11

You'll need to add in the appropriate permissions and host for the username. At the very least, you'll need to grant the username access from that ip address...

You'll find more on this here http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

0
 
emincoteAuthor Commented:
Hi Mike and anyone else in this situation.  Success at last.  To install phpMyAdmin on an IIS6 box to talk to another server do the following:

Install the fastCGI msi from Microsoft first.
Install PHP using the msi.  Do not use the new Microsoft Web Application Installer.  You won't be able to select or installl the extensions you need.  You will need the following extensions:
bzip2
GD2
MB String
Mcrypt
MySQL
MySQLi
zip

Set up your website including the php executable.  Then finally read the documentation and use the config with the user name in the config.ini.php file and remore the example file.

I hope that people will benefit from my days of head scratching!!

Thanks to Mike and Experts Exchange
0
 
emincoteAuthor Commented:
Helped by a lot of trawling around as well and keeping going with different options.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now