Did location of mysql.sock change in mysql5.0.37?

Emory Smith emory.smith at gmail.com
Mon May 7 09:02:13 PDT 2007


On May 5, 2007, at 9:02 PM, Bakki Kudva wrote:

>  I just did a port -u update and didn't get any errors.

are you sure the mysql5 daemon is running? (try running "ps aux |  
grep mysqld")

if you really just did "port upgrade", its probably still the mysql4  
daemon running on the envirnment thats working.

if so, youll probably need to kill it manually with "sudo killall  
mysqld_safe" (assuming mysql4 was deactivated).

then to setup and start mysql5 (preserving your old databases under / 
opt/local/var/db/mysql):

sudo mkdir -p /opt/local/var/db/mysql5
sudo chown -R mysql:mysql /opt/local/var/db/mysql5
sudo -u mysql mysql_install_db5
sudo chown -R mysql:mysql /opt/local/var/run/mysql5

sudo -v
sudo mysqld_safe5 &

and set root pw with:

mysqladmin5 -u root password '<secret>'
mysqladmin5 -u root -h localhost -p password '<secret>'

you can then use mysql_dump & mysql_import (or rails magic) to  
recreate your databases from 4.

-emory


On May 6, 2007, at 1:00 AM, Steven Rogers wrote:

>
> On May 5, 2007, at 10:02 PM, Bakki Kudva wrote:
>
>> I am stumped now because the same upgrade on a MacBookPro seems to
>> work fine. So something went awry when I upgraded the iMac. I just  
>> did
>> a port -u update and didn't get any errors.
>
>
> I had the same problem - rails works fine on one machine, and is  
> looking for the MySQL socket in /tmp/mysql.sock on another after  
> updating. I haven't been able to figure out what the difference is.
>
> There are a number of ways to work around this:
>
> 1. adding the socket to database.yml - I didn't want to do this,  
> because it's not the same on all my servers.
>
> 2. use 127.0.0.1 instead of localhost for the address, which forces  
> uses of TCP/IP instead of sockets - I didn't want to do this  
> because there are probably performance issues, or
>
> 3 create a link in the /tmp directory that points to the correct  
> location (mine is in /opt):
>
> $ ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock
> however, I suspect this may be removed by any number of cleanup  
> routines, including a restart, so it might need to be recreated  
> occasionally. Still, for me this seems like the best option.
>
> There may be something about Rails or its configuration that could  
> cause this issue - if I figure it out, I'll post it.
>
> Good luck,
>
> SR
>
>
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-users




More information about the macports-users mailing list