Accessing XAMPP MySQL database remotely + locally

This weekend, I was playing around with XAMPP which I am thinking to use for my quest to become familiar with WordPress development. For those who don’t know what the hack is XAMPP, it is cousin of WAMP and it basically provides development environment for PHP based applications (e.g. WordPress). It is basically combo package of essential modules like Apache, MySQL, PHP and few other add-ons (Mercury and Tomcat). Good thing about using packages like XAMPP or WAMP is when we install them they just configure all components to talk with each other so you don’t need to do any kind juggling for setting up each of those individual components before using them Smile. On internet there are many walkthroughs available about to how to setup XAMPP, so I am not going explain that process.

But here in my case, I have a virtual machine where I have installed XAMPP and I wanted to access that MySQL database from my host system. Main reason for that is I never liked phpMyAdmin to manage MySQL instance and MySQL Workbench is by far very flexible and less confusing to use. I already have MySQL Workbench installed in my local system and I wanted to use that application to access database located in my virtual machine. I must say that if it was SQL Server it is very straight forward process but I didn’t expect that it will be really difficult to setup  for MySQL ! Because by default use don’t have permission to access MySQL instance remotely and you have to configure server logins to have permissions to access database remotely. And may be I am wrong, but it looks like that users are bound with specific IP so that user has access to server only from that specified IP (or IP range).

To connect to remote instance of MySQL you have to modify existing user or create new user and have that user permission to access instance from some IP (more better could be to have just some IP range). This can be using phpMyAdmin UI. Just go to “Privileges” option and select “edit privileges” for any user you want to use for remote access. And then into “Change Login Information / Copy User” section select “Use Text Field” from dropdown list for HOST settings and add IP (or IP range using wild cards % and _ ) for example in my case I used 192.168.%.% IP range because I was accessing machine on local network.

default_users

Once that setting is changed, all I had to do was to allow port 3306 in firewall and I was able to connect to that remote instance of MySQL using MySQL Workbench without any issue.

config_change

Now all I have to do is to create user and database for my WordPress setup and have some kind of source control system (I already have Visual SVN server setup for other .NET projects, this should come handy Smile ). I am hoping that after this much of efforts I will be able to design my WP theme for my own blog Open-mouthed smile

That’s it for now …

It’s Just A Thought … Peace

Gaurang Sign

Leave a Reply

Your email address will not be published. Required fields are marked *