Saturday, December 25, 2010

MySQL 5.5 Startup Problems On OS X 10.6.5

Today morning I downloaded MySQL Community Server 5.5.8 for OS X 10.6.5. I downloaded 64bit disk image and started installation by first installing mysql-5.5.8-osx10.6-x86_64.pkg, followed by startup item - MySQLStartupItem.pkg - and then the system pref pane - MySQL.prefPane. Everything went well with the installation. After that I opened System Preference and clicked on MySQL pane to start the server. When I clicked on Start MySQL Server button, nothing happened. Neither server started nor did I get any confirmation message or any error message. Reason for such failure to start is the server startup script - mysql.server - is missing the MySQL installation directory path as well as MySQL data directory path. To resolve this locate basedir= and put entry as shown below and save the file. mysql.server file can be found under /usr/local/mysql/support-files directory

basedir=/usr/local/mysql
datadir=/usr/local/mysql/data

Alternatively above entries can also be put in /etc/my.cnf file too. Better place to put this instead of modifying packaged/default startup script - /usr/local/mysql/support-files/mysql.server. Anyway its individual choice.

Now try to start the server by clicking Start MySQL Server button in MySQL System Preference pane. I could start the server and can create a new server instance using MySQL Workbench. I was a happy man. But my happiness did not end long. As soon as I restarted my laptop, I got an annoying alert...

Insecure Startup Item disabled. “/Library/StartupItems/MySQLCOM” has not been started because it does not have the proper security settings.
This was because an entry in /etc/hostconfig as MYSQLCOM=-NO-. Due to ownership issue on startup item MySQLCOM, above alert was flashing on OS startup. To fix this just change the ownership of MySQLCOM startup item as shown below

sudo chown -R root:wheel /Library/StartupItems/MySQLCOM
To test just logoff or restart the system and that Insecure Startup Item disabled alert should not come again.

Cheers !!!
- Jay

62 comments :

  1. Jay,
    thanks for taking the time to post your experiences - I have been having the same problem. However, I simply cannot find the file mysql.server - where is it located?

    ReplyDelete
  2. Glad that it helped. You can find mysql.server under /usr/local/mysql/support-files directory. I'll update the article to have this location. Thanks for your comment.

    ReplyDelete
  3. THANK YOU!!!! The "insecure startup item" was driving me nuts!
    I really don't understand:
    a) how the folks at MySQL blew it so bad when creating the Mac installer
    b) why they have been unresponsive to the bug reports I've filed on this
    This is no small thing, and I'd have thought they'd be all over it.

    ReplyDelete
  4. thanks a lot - i even tried reinstalling mysql last night before i came across your entry today! - Fortunately it was my home machine not my production machine that went belly up because of the update. At this point I'd really appreciate if apple came up with their own mamp like system that's easier to maintain and configure on osx client.

    ReplyDelete
  5. Huge help to me, too. Thanks Jay.

    ReplyDelete
  6. You can also add a my.cnf in folder ect with:
    basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data

    --Frank

    ReplyDelete
  7. Thank you soooo much. This problem was driving me nuts the whole day.

    Greetings from Austria,

    Hannes

    ReplyDelete
  8. great! Thanks.

    ReplyDelete
  9. @ Frank, thanks for pointing out my.cnf. I guess its better place to put this instead of default startup script. I'll update the article accordingly.

    ReplyDelete
  10. The above and several other posts online regarding this still didn't get mysql working for me. If anyone else is still having problems after trying the above, see

    http://blog.salientdigital.com/2010/12/31/mysql-wont-start-on-snow-leopard/

    Nutshell:

    sudo mysqld_safe -u root

    ReplyDelete
  11. I found the file, but could only open it with TextEdit in order to add the code. However it wouldn't let me save it even though I have permissions. What app should be used?

    ReplyDelete
  12. @ Liam you can open it using vi from terminal. just enter "sudo vi /usr/local/mysql/support-files/mysql.server" (without quotes).

    You can also create my.cnf file under /etc directory. Since you have created it you can edit/save it without sudo permission

    ReplyDelete
  13. This was a fantastic post! Really appreciate it! Worked for me!

    ReplyDelete
  14. Thanks Jay, you're a lifesaver. :-)

    ReplyDelete
  15. Legend Jay...many thanks!

    ReplyDelete
  16. Thank you, thank you, thank you and thank you.

    ReplyDelete
  17. This was great. Thank you.

    ReplyDelete
  18. Thanks for posting this! The MySQL manual was no help at all...you are a lifesaver

    ReplyDelete
  19. amazing, thanks a lot, it solved my problem !

    ReplyDelete
  20. thanks, i spent hours with solutions from other posts but this is the only solution that works!

    ReplyDelete
  21. Thanks you Sir! dreadful mysql install on a MAC

    ReplyDelete
  22. Thank you, this enabled me to start my 5.5.8 server. I noticed your user feedback on http://dev.mysql.com/, read your blog, noticed the absence of the basedir and datadir values in my own installation, and fixed it through your advice.

    ReplyDelete
  23. Thanks for the information , now MySQLServer is working fine . . .

    I installed mysql-5.5.8 on Mac OSX 10.6.6 , have the exactly the same problems :)


    Cheers from México !!

    ReplyDelete
  24. Thanks a lot for the information but i face an error when i try changing the MySQLCOM file. After typing in the command in terminal it asks me for my password and then i receive an error message saying

    "chown: /Library/StartupItems/MySQLCOM: no such file or directory"

    ReplyDelete
  25. @ Ashish, have you installed MySQLStartupItem.pkg after installing mysql-5.5.8-osx10.6-x86_64.pkg?

    ReplyDelete
  26. did that....it works now! thanks once again! :D

    Ashish tayal

    ReplyDelete
  27. When trying to start the mysql server, its giving me this error

    "ERROR! The server quit without updating PID file ..."

    ne solution?

    ReplyDelete
  28. @ ChinmaY, no idea on this error, but a quick goole gave this links. May be useful

    http://icesquare.com/wordpress/starting-mysql-error-the-server-quit-without-updating-pid-file/

    http://icesquare.com/wordpress/mysql-starting-mysql-error-the-server-quit-without-updating-pid-file/

    ReplyDelete
  29. When i start mysql it shows the error window? If i use mysqld.exe it tells that could not connect to localhost?

    ReplyDelete
  30. The "MySQL System Preference pane" that comes with the 64bit package of MySQL 5.5.9 does not work on intel-based macs :(
    I installed only the prefpane from MySQL 5.1.51 and it's all sorted...

    Anyone knows the remedy for this prefpane of 5.5.9?

    ReplyDelete
  31. Thanks heaps, solved the problem :)

    ReplyDelete
  32. Jay,
    Im not familiar with terminal. can u post a detail to solve this problem
    best regards
    Hazwan

    ReplyDelete
  33. Hazwan, terminal is like command prompt in windows. You can find Terminal.app under /Applications/Utilities directory

    ReplyDelete
  34. Jay,
    Yup i know that. the problem here. the guideline is quite blur. I still in learning process in using terminal. I'm not quite familiar with it. Can u show me detail guideline to solve this problem. sharing is caring. ^^ tq for reply my comment

    ReplyDelete
  35. Hazwan, not sure exactly which part is "blur" if you can be specific I can try to clear your doubt...

    ReplyDelete
  36. Thanks, Jay! I have been having a variety or problems since installing this version of MySQL and your post solved this one for me. Now if could only figure out why it won't let me delete the 'test' db… :-)

    ReplyDelete
  37. @ neo, glad that this post helped you. Regarding deleting test db using mysqladmin remove the test db (mysqladmin drop test). You might get following error

    error: 'Error dropping database (can't rmdir './test/', errno: 17)'

    This because mysqladmin could not delete the data dir of your test schema. Go to /usr/local/mysql/data directory and remove the directory test and you should be fine.

    Word of caution, Above operation will delete all tables and any objects you have created. So before performing any of above, make sure you dont have any of your data.

    ReplyDelete
  38. Very helpful!!! thank you!

    ReplyDelete
  39. This was a good post. For me, I used fink to install MySQL and needed to use the below in the my.cnf and mysql-server files

    basedir=/sw
    datadir=/sw/var/mysql

    and also create links (ln -s) to setup the default looking paths that the panel looks for.

    ln- s /sw /usr/local/mysql
    ln -s /sw/share/mysql /usr/local/mysql/support-files

    ReplyDelete
  40. Thanks -- It is very concise, clear & helpful.
    David Chhetri

    ReplyDelete
  41. Actually it doesn't help for me.. In mysql/data just files with name mysql-bin.000001, mysql-bin.000002 etc creates. What's wrong? *note* Should you just put "basedir=/usr/local/mysql ** datadir=/usr/local/mysql/data" anywhere in my.cnf?

    ReplyDelete
    Replies
    1. Nicolas, I'm not sure what exactly wrong with your installation. A quick google landed me to this link. Hope this helps you http://bugs.mysql.com/bug.php?id=60660

      Delete
    2. Thanks, but they didn't come up with any solution there

      Delete
    3. Ah, I thought at the last there is a summary of what that guy did and it resolved. Anyway if you find the solution then please let me know by posting a comment so it can be useful to me and others visiting this post. All the best.

      Delete
    4. I solved it! I followed along the last steps of this http://blog.mclaughlinsoftware.com/2011/02/10/mac-os-x-mysql-install/ and it worked!

      Delete
  42. wonderful information, I had come to know about your blog from my friend nandu , hyderabad,i have read atleast 7 posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again, Regards, MySql online trainingamong the MySql in Hyderabad. Classroom Training in Hyderabad India

    ReplyDelete
  43. I just had to write a THANK YOU note to you!! I spent over 2-3 hours trying to figure out and use suggestions from all over why my MySQL installation (v5.6) wasn't working on my Lion MacBook Pro. Your suggestions solved my problem immediately, just when I was about to quit for the day! Thank you :D

    ReplyDelete
  44. Thanks Jay!!. Thanks to people like you and intentions like yours, knowledge and experience are full of freedom to whom look for them!!

    ReplyDelete
    Replies
    1. Thanks Alex for the kind words and glad that it helped you

      Delete
  45. is it possible to get a step by step process? I'm completely new to using terminal and my sql and you're instructions seem more for someone with an advance understanding

    ReplyDelete
    Replies
    1. Not sure what exactly is not clear. In fact I faced/wrote this when I was new to OS X. You can use spotlight or go to /Applications/Utilities directory to find terminal - Terminal.app. Start MySQL Server button can be found by opening System Preferences -> MySQL. Hope this helps

      Delete
  46. I usually do not leave a response, but after looking at a few of the comments on this page
    "MySQL 5.5 Startup Problems On OS X 10.6.5". I actually do have a few questions for you if you don't mind.
    Could it be just me or do a few of these
    remarks look like they are left by brain dead individuals?
    :-P And, if you are writing on additional places, I would like to keep
    up with anything fresh you have to post. Could
    you list of every one of your social pages like your twitter
    feed, Facebook page or linkedin profile?

    Here is my web page: adobe; http://www.adobe.com/,

    ReplyDelete
    Replies
    1. Not sure why you say so about others without knowing them or their learning/experience level. Anyway its your views, but I personally think learning is best by sharing and asking. Have a great day.

      Delete
  47. didn't work for 10.9.4 OSX. Anything you recommend ?

    ReplyDelete

 
Disclaimer : This is a personal blog and all content represent what I think and it does not advocate/support/advertise any other person/company. I do not earn money or intended to do so with this blog or any of the contents the blog hosts (except the google ads which you see). If I post something here that you find helpful, that's wonderful. Just in case, if I say something stupid, the stupidity is mine, and mine alone and I can not be held for anything if you fall for such stupidity :-). I cannot be held responsible for any kind of damage that may be caused by downloading or viewing the files or information provided herewith. Anybody and everybody can use/refer the contents of this blog at their own will and of course at own risk. There is no need for any kind of approval of the author. Although it would be great if feedback is left for any such usage to the author.