Script installer fails with remote mysql database

I set up a remote MySQL server using the documentation at: http://www.virtualmin.com/documentation/database/remote

and successfully hooked it to a Virtualmin server. Creating a virtual domain worked, and the initial database was created on the Webmin MySQL server.

However, when trying to install Wordpress on the virtual server, the installer fails with the following error: Now installing WordPress version 3.3.1 .. Database connection failed : DBI connect failed : Access denied for user 'iriehilltop'@'ip-xxxxxx.ap-southeast-1.compute.internal' (using password: YES) 1360. .. failed! See the error message above for the reason why.

When I look at the Webmin MySQL server list of MySQL users, I see: iriehilltop ec2-xxxxxx.ap-southeast-1.compute.amazonaws.com so that must be the one created when the virtual domain is set up.

So now I have also added another root user ALL perms from ec2-xxxxxx.ap-southeast-1.compute.amazonaws.com to see if that is the issue But the installer still fails.

I look at the Webmin MySQL server's database list, and I see iriehilltop_wordpress is created, but has 0 tables. I get the same result if I try the installer with the originally created database.

obviously this is on AWS EC2...

Is there anything I can do to be able to have the script installers work properly and create the proper remote database tables and users? Or is this a bug?

Status: 
Closed (fixed)

Comments

Also user iriehilltop has ALL permissions for both databases, and has user permissions from localhost and ec2-xxxxxx.ap-southeast-1.compute.amazonaws.com, but there is no automatic created user permission for that user from ip-xxxxxx.ap-southeast-1.compute.internal, which seems to be the host that is specified when the user is created.

The system hostname on the Virtualmin instance is ec2-xxxxxx.ap-southeast-1.compute.amazonaws.com ... not ip-xxxxxx.ap-southeast-1.compute.internal

I am hoping to have automatic script installer work properly with the remote MySQL server.

Also I have set Host Permissions ALL db's ALL operations for internal and external IP addresses and hostnames... installer still fails.

Can you connect from the command line on the Virtualmin system to the remote MySQL?

The command for this would be like :

mysql -u iriehilltop -pPASSWORD -h REMOTE-SYSTEM

Replace PASSWORD and REMOTE-SYSTEM as appropriate.

Hi Jamie,

The login fails, because the password on the Webmin MySQL server is not the same as the password on the VM server.

ERROR 1045 (28000): Access denied for user 'iriehilltop'@'xx.xxx.xxx.xxx' (using password: YES)

If I create a new iriehilltop mysql user with the same password as the one created on the VM virtual domain, and ANY host, I can ssh mysql to the WM server.

see screenshot... hashed passwords do not match.

I have tried changing the host for user iriehilltop on the WM MySQL to VM's Elastic IP and also VM's Private IP, both of which also fail.

HOWEVER... When I change the database permissions for iriehilltop to use the VM Instance's Private IP address (or the Private DNS name), then the install is SUCCESSFUL. It seems the AWS platform wants the Instances to communicate via the private IP & DNS.

So it looks like I need to know how make the Private DNS name be designated as the host when the databases are created, or have the script installer figure this out, so the install will happen automagically.

Both of these servers are built on the same AMI, with Virtualmin preloaded, and the Webmin server was downgraded by UNinstalling Virtualmin and then installing Webmin.

Ok, that makes sense now. What you should do is login to Virtualmin as root and go to System Settings -> Server Templates -> Default Settings -> MySQL Database, and in the "Allowed MySQL client hosts" field enter the internal IP of your Virtualmin system. Then click "Save".

This will only apply to domains and databases created from now on though.

Thank You Jamie!

This is the first time I have worked with a Virtuamin server in a NAT environment, so I was not schooled on the proper procedure... but now I have the knowledge. Thank You!

Virtualmin teaches the old dog another new trick.