Installing Mysql5 port on top of an existing mysql5 on Leopard and using Rails

Scott Haneda talklists at newgeo.com
Tue Apr 28 17:47:53 PDT 2009


On Apr 28, 2009, at 5:06 AM, Chris Janton wrote:

> On 2009-04-27 , at 19:54 , Scott Haneda wrote:
>
>> If this is the case, shut down mysql server.  You should find your  
>> old data at
>> /usr/local/mysql/data
>>
>> You should see your new mysql data from macports at:
>> /opt/local/var/db/mysql5
>
> That accomplishes getting the data moved to where the mysql5  
> installation wants it to be by default, but it doesn't accomplish  
> having your data where it is independent of whose distribution of  
> mysql5 that you use - Apple, MySQL, ports

True, but I have been under the impression, that when you use ports,  
you want to keep as much as possible within the port dirs.  Sure, you  
can move things to where you like, and may even need to, for example,  
put http docs on a faster raid or something.

I was sort of under the impression the OP was doing small local  
development, and feel his setup should be contained within ports, if  
for anything, for being on the same page as everyone else.

> Lots of "applications" let you specify how to get to the mysql data  
> via the socket interface - you may just want to change the config  
> file for the app...
>
> There's a very simple way to keep your data in one place - use /etc/ 
> my.cnf to define things.

I could not find out where the ports version of mysql5 looks for  
my.cnf as defaults.  Do you know where it is looking within the opt/ 
local area?  I do not have a cnf file at /etc or /opt/local/etc

The only reference I can find to it now is
/opt/local/var/macports/sources/rsync.macports.org/release/ports/ 
databases/mysql4/files/my.cnf

Of course, that is not the correct one, and is part of the mysql4  
build files.

I personally believe that the my.cnf file should live in /opt/local/ 
etc/my.cnf in the case of MacPorts.

Something is defining the sock file, I just can not find it.

> My example uses the "default" location of data based on the OS X  
> Server definitions - you could just as easily use "/var/lib/mysql"  
> like Centos, or whatever.
>
> in the [mysqld] section add
>
> basedir = /opt/local
> datadir = /var/mysql
>
> in the [client] section
>
> socket = /var/mysql/mysql.sock
>
> I added the following set of definitions to "make sure" that things  
> got it straight
>
> # face - 20070227
> [mysqld_safe]
> basedir = /opt/local
> datadir = /var/mysql
>
> [mysql.server]
> basedir = /opt/local
> datadir = /var/mysql
>
> [mysql_config]
> socket = /var/mysql/mysql.sock


I do think it is worth considering, that MacPorts tries to keep things  
contained in its own little home.  For me, it certainly makes backing  
up data, and knowing that all but launchd items are in one place. For  
me, I like that methodology, unless I have a really good reason to  
over-ride it, such as needing to move active files off the boot drive.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *



More information about the macports-users mailing list