Mysql – installing phptheadmin for remote db host

amazon ec2amazon-web-servicesMySQLrds

I am having trouble trying to install phpmyadmin. We are using AWS services for our servers. Our mysql db is located in an RDS instance. Now I am trying to install phpmyadmin on an EC2 instance.

I have installed mysql-client on the EC2 instance. When I try to install phpmyadmin, the install dialog prompts me to create a database for phpmyadmin, asking me the root user credentials.

The problem is, by default the install dialog is trying to log into the database instance at localhost, which does not exists because our db instance is on a remote RDS instance.

I can skip this step and install phpmyadmin, make the necessary configurations and login to the db instance on RDS, but can not execute queries because of the missing phpmyadmin table.

How can I get the phpmyadmin install dialog to use the db instance on RDS by default?

Best Answer

That dialog comes from apt-get attempting to make your configuration easy for you, but it seems to assume you're installing to a database on the local machine. In this case, you should say no to that dialog; you'll have to manually configure the "phpMyAdmin Configuration Storage". Even though the dialog says you "must" have the database installed, I don't think that's true. It's certainly not true with the official release; it works perfectly fine without configuring those advanced features.

Once you install phpMyAdmin through apt-get, you'll need to edit the configuration file to point to the RDS database hostname or IP address. I'm pretty sure you'll find the configuration in /etc/phpmyadmin/.

Once you've gotten phpMyAdmin installed, you can use the documentation in /usr/share/doc/phpmyadmin to create the database manually (you'll most likely log in through phpMyAdmin and upload the file), but again, I don't think that's needed at all.

What I would do, however, is just download the source from http://www.phpmyadmin.net/ and uncompress it yourself in to your web root folder (which is likely /var/www/) and configure it manually. That way you're not confusing apt-get.

Hope this helps get you on your way.

Related Topic