This post describes how we’ll consolidate our Windows and Linux MySQL development environment to leverage the strengths of both platforms and keep those lines of code flowing. Our approach to this happy union is to assign a Static IP to our Linux box and directly link to Linux resources from Windows. We’re already doing a lot of content sharing after installing Samba on our Linux Box and using the excellent Ubuntu One Cloud File Sharing service. Our work today will take us to application level integration.
Assigning a Static IP to our Linux Box
There are several good guides on how to do this. Here’s a guide on how to assign a static IP, though you’ll have to substitute “Windows Home Server” in the article with “Linux.” If you have a sweet Linux Distro like Linux Mint 14 (the current version) you’ll never see a command line, except maybe to restart network services. That command, by the way, is
sudo /etc/init.d/networking restart
Here’s the Cinnamon Desktop Wireless adaptor settings dialog box Linux Mint and the numbers we used to set our static IP.
MySql Configuration Changes
Next we’ll update the configuration of MySQL running on our Linux box. It is configured for localhost and 127.0.0.1. Since we’ve changed our network IP to 192.168.1.200 we’ll have to let our Linux MySQL Instance know about it or we won’t be able to use it after the new IP take effect.
Our first stop will be my.cnf in /etc/mysql where we’ll change the bind-address from 127.0.0.1 to our static IP of 192.168.1.200.
PHPMyAdmin is a great tool for managing our MySQL instance in Linux, so we want to make sure it will continue to work with the new IP. We’ll do that by first modifying config-db.php located in /etc/phpmyadmin, updating the $dbserver property.
MySQL User Updates
We need to create a MySQL user account to use from our Windows machine. That username will be “netdude.” We will set netdude’s host access settings to
That’s important, which means we can use netdude to access our Linux MySQL databases from any other machine on our Workgroup.
One final user configuration stepbefore we pull the IP switch is to set the host access address of our MySQL ROOT user to our static IP address of 192.168.1.200.
We’ll talk more about how we’ll use our more closely joined Windows and Linux machines in future posts, but for now here’s a big win for us out of the gate, the ability to access both Windows and Linux servers from the same MySQL Workbench running in Windows.