Need help activating Macports install of MySQL5 on Snow Leopard

Ryan Schmidt ryandesign at macports.org
Mon Dec 14 17:51:54 PST 2009


On Dec 14, 2009, at 18:24, William H. Magill wrote:

> Today, I have had occasion to install mysql for the first time -- I need it for a backend to a separate program.
> 
> Macports has been working fine after upgrading to Snow Leopard and re-installing,  and I have been using it for the things I've used it for in the past... no problems.
> I'm a UNIX Systems Administrator by background, with virtually zero DBA experience. (And the little I had was with Ingress under VMS, long ago.)
> 
> All of the documentation at dev.mysql.com I can find is for Leopard. (And for their pre-packaged install GUIs).

We have some documentation about the MacPorts mysql5 setup process, somewhat non-intuitively tucked into the MAMP (MacPorts / Apache / MySQL / PHP) how-to page:

http://trac.macports.org/wiki/howto/MAMP


> The macports "port install mysql5" has worked fine... all the components and pre-requsites  are apparently installed (someplace, which is a separate problem).

"port deps mysql5" tells you mysql5's dependencies.

"port contents mysql5" tells you what mysql5 installed adn where.


> Searching the web, I managed to  find a plist file for starting MySQL under Snow Leopard's Launchd... that works like a champ.

You don't need to search the web; you just need to "sudo port install mysql5-server". It will install an appropriate launchd plist and tell you how to use it. When you installed mysql5, it should have told you this was only the client libraries, and that for a server, you need to install mysql5-server as well.


> However, MySQL still did not work. (The daemon was not  continuing to run.)
> 
> So I started reading through logs.
> Then I hunted around in the /opt/local/lib/msql5/bin directory and found:   mysql_install_db and ran it.

mysql5-server tells you how to run mysql_install_db when you install it.


> That apparently worked, as it created /opt/local/var/db
> 
> I then tried to run the admin routine it described...
> 
> nada... turns out there are a number of directories and permissions which need to be created and set,a
> which were not done by the macports install of mysql5. -- Namely the /opt/local/var/db  and /opt/local/var/run trees.

mysql5-server creates these directories for you with the right permissions.


> Now the Daemon continues to run, but MySQL still needs "initializing."
> 
> I don't know if I still need to do more things using the macports mysql tools (and which ones), or if I need to find something specific to generic Mysql.
> I'm assuming I am tripping over all of the things which only ever need to be done once when MySQL is first installed, and never again under updates.
> 
> So, I'm looking for some kind of tutorial/cookbook for "installing" MySQL5 on Snow Leopard.
> 
> Quite frankly, at this point, I don't know what i don't know, but assume it to be substantial.

Give the MySQL section of the MAMP how-to a try and please make any necessary corrections (or let us know and we'll make them).




More information about the macports-users mailing list