Every time I start my system. I have to run a command

 sudo /usr/local/mysql-5.5.9-osx10.6-x86_64/support-files/mysql.server start

to start mysql. How can I start it automatically on login (System start)?

  • 2
    fyi, login and system start are not the same thing
    – user1686
    Mar 26 '11 at 22:58
  • Please accept my answer if it worked for you or comment on it so I or others have the opportunity to solve your problem. This question was just bumped to the front page, since the system considers it unanswered.
    – Daniel Beck
    May 30 '11 at 18:09

How did you install MySQL?

There are official installer packages for OS X, that have an installer for a startup item and a preference pane for System Preferences to easily toggle auto-start of MySQL.

  • Didnt worked for me..
    – Mohit Jain
    May 30 '11 at 19:28
  • @Mohit That's why I asked how you installed it. There are multiple ways to do this, and this answer works for one of them.
    – Daniel Beck
    May 30 '11 at 19:31

Don't know how you installed MySQL, but if you have a MySQL symlink in /etc/init.d then you can run update-rc.d as follows which will add mysql to your list of apps which are run at system start-up.

sudo update-rc.d mysql defaults

For info on update-rc.d use:

man update-rc.d
  • -1, the user is on OS X, there's no such thing as update-rc.d.
    – slhck
    Apr 28 '12 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.