Page 1 of 1

Changed to static IP, now MySQL won't run

PostPosted: 27. October 2007 01:50
by whipkey
My test server (Ubuntu Feisty 7.04 running on Parallels) was set to DHCP and when my router lost power it would not get the same IP address back. This messed up my virtual host configurations on my working machine (Macbook Pro). Basically, I had virtual hostnames entries in my Mac's hosts file to point to an internal IP address. The Lampp vhosts.conf file is set properly to handle the hostname and show the correct files.

Everything was working great until I set my Ubuntu box to use a static IP address. I did this by editing the /etc/network/interfaces file with the following settings:
Code: Select all
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.150
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.0.1


As of now I can resolve my virtual hostname from a browser on the Mac to the lampp server but it just can't connect to the database. Actually, the I can't even connect to mysql from the Ubuntu terminal. I try this:
Code: Select all
sudo /opt/lampp/bin/mysql -u root -p


and I get this:
Code: Select all
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2)


Again, the only thing that changed between when it worked great and this problem was the static IP address.

Any ideas?