Skip to content
Home » Auto start MySQL on Mac startup

Auto start MySQL on Mac startup

If enabling “Automatically Start MySQL Server on Startup” does not work then doing below process will fix it.

Open terminal/command line interface (CLI) and run below commands.

  1. run “sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist” and add below code and save the file. If vi does not work then create file “com.mysql.mysql.plist” in “/Library/LaunchDaemons/” and save below code.
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
    <plist version=”1.0″>
    <dict>
    <key>KeepAlive</key>
    <true />
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/mysql/bin/mysqld_safe</string>
    <string>
    </array>
    </dict>
    </plist>
  2. sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
  3. sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
  4. sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

Now restart the system and see that MySQL will be in running mode and no need to manually start.

Leave a Reply

Your email address will not be published. Required fields are marked *

0 Shares
Tweet
Pin
Share
Share
Share