13

The last two times I've used MacPorts to install mysql5 +server, the plist isn't installed that allows me to have MySQL start on launch. I can't remember what, if anything, I did the on the last install and I can't seem to find a way to get it installed. Am I missing something? How can I either get the plist file (the only way I know of to start MySQL automatically) or start MySQL automatically in another way?

Thanks.

UPDATE: I still haven't found an answer anywhere, but I installed the files manually. One of my machines with an older install had the relevant files so I SCP'd them to my new machine, created the appropriate symlink in /Library/LaunchDaemons and executed the command to load the plist file. Everything's fine for me now, but that doesn't help anyone else. If anyone needs these files and/or instructions, contact me through http://robwilkerson.org/contact and I'll be happy to provide them since I can't upload them here.

Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
  • have you tried this guide? http://2tbsp.com/content/install_and_configure_mysql_5_macports worked for me last time I ran it – catsby Jul 08 '09 at 19:36
  • 1
    Yep. In this case, it's the first step - the port install mysql5 +server - that simply doesn't install the plist files and wrapper. I'm not sure when it stopped doing that, but I've installed MySQL 3 times via MacPorts. The first time I got it all, but the last 2 have been missing the plist files. – Rob Wilkerson Jul 09 '09 at 16:38

4 Answers4

26

The mysql5 +server package variant in MacPorts is obsolete, and is superseded by the mysql5-server package, which you install in addition to mysql5. This allows you to build it after the fact, instead of re-compiling the entire mysql5 package with +server.

I'd suggest to just remove your old mysql5 +server, and install using the following.

sudo port install mysql5-server

That'll build both the required mysql5 and mysql5-server packages for you, and you'll have the mysql5 plist file in /Library/LaunchDaemons. Also note that you no longer need to symlink your mysqld.sock to /tmp/mysql.sock.

Michael Richards
  • 1,791
  • 14
  • 19
  • Thanks, Mike. I don't have an extra Mac around right now. Are you confirming (or able to confirm) that this really works the way you describe? If so, then obviously this is the "correct" answer and I'll make the appropriate adjustments. – Rob Wilkerson Jul 28 '09 at 13:42
  • Yes, I just installed MySQL this way and it works nicely. The official MacPorts documentation refers to installing mysql5-server now as well. – Michael Richards Jul 28 '09 at 14:57
  • 2
    Thanks -- now -- if someone would just go fix the myriad and piles of WRONG INSTRUCTIONS that no longer work. Better yet, why the heck does `mysql +server` still exist if it **doesn't bloody work**?!?!? But.. again... thank you. +1 – bbum Apr 08 '11 at 04:48
2

to install mysql correctly on macports: http://www.jasonrowland.com/2009/10/install-mysql5-on-snow-leopard-using-macports/

mtay
  • 1,336
  • 4
  • 20
  • 36
1

Yes it is true. Many existing blog are still using the out-dated link to install mysql.

Outdated macport command line:

$ sudo port install mysql5 +server
sth
  • 222,467
  • 53
  • 283
  • 367
Bess
  • 11
  • 1
0

As I mentioned in an update above, I installed the files manually. As far as I can tell, there's no reason that the files don't exist and no one is talking about it, so I may be the only one having an issue with this. Having fixed it for myself using an old set from when things did get installed and given the number of requests I received for the files and instructions, I decided to blog it.

The post provides links to a copy of my plist files and instructions for installing them. It's available at http://robwilkerson.org/2009/07/16/macports-mysql-5-and-the-launch-daemons/.

Update: The article referenced above has been updated to reference the solution offered by Mike.

Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192