I’m trying to set up a web application for the first time on Amazon ec2 and everything is working except for remote access of PHPMyAdmin from the webserver instance. I’ve set up two ‘Basic 64-bit Amazon Linux AMI 2011.02.1 Beta’ instances of which one is acting as the webserver and the other as the MySQL server. Apache is installed on the webserver together with php and mysql, and the MySQL only has mysql server installed.
I have set these two servers up by following these instructions :here and setup PHPmyAdmin following these: here. I have installed PHPmyAdmin on the webserver. Now the problem is that whatever I try I get a ‘1045 Cannot log in to the MySQL server’ warning while trying to log in. However I do get access when executing normal php-scripts fom the webserver or when I login through mysql while being logged in into the webserver.
I’ve granted the root user all privileges on the public IP, on the public DNS, on the ip written as ‘ip-111-222-333-444’, on ‘%.internal’, the internal ip and even on ‘%’, but it still doesn’t work(see mysql.user tabel below). Also included below is the config file from PHPMyAdmin.
I hope to hear what I’m doing wrong and how I can fix it. Am I using the wrong ip’s for the GRANTS or for the mysql server, or is there something else? If more information is needed please let me know.
| host | user | password
—–+——+——————————————-+
localhost | root | PASSWORD |
ip-own-server-ip | root |
127.0.0.1 | root |
localhost | |
ip-‘own-server-ip’ | |
ip-‘public-dns-webserver’.compute.internal | root | PASSWORD |
% | root | PASSWORD|
‘PUBLIC IP’ | root | PASSWORD |
ip-‘PUBLIC IP’ | root | PASSWORD
%.internal | root | PASSWORD
ip-‘public-dns-MySQLserver’.compute.amazonaws.com | root |PASSWORD
| ip-‘LOCAL IP-ADDRESS’ | root | PASSWORD|
PHPMyAdmin config.ing.php file
<?php
/*
* Generated configuration file
* Generated by: phpMyAdmin 3.4.0 setup script
* Date: Sun, 22 May 2011 11:01:18 +0000
*/
/* Servers configuration */
$i = 0;
/* Server: HipHop [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'HipHop';
$cfg['Servers'][$i]['host'] = 'ec2ip-xxx-xxx-xxx-xxx.compute.amazonaws.com';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* End of servers configuration */
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['blowfish_secret'] = '4dd8eb378ebd13.46094950';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
I am assuming http://localhost/phpmyadmin/ works. My suggestion is to redownloaded the latest version to get a copy of the sample inc file (config file) and used that as the base for inc file. Now enter your configuration settings in the new file. Seems to be something problem with the config file itself.
Good Luck 🙂