MySQL does not start when upgrading OSX to Yosemite or El Capitan

后端 未结 18 2035
南方客
南方客 2020-12-04 09:59

I know similar questions exist, such as MySQL with MAMP does not work with OSX Yosemite 10.10. However, I do have MAMP, nor XAMPP installed on my computer.

When I tr

相关标签:
18条回答
  • 2020-12-04 10:25

    Way simplest: copy and paste this into Terminal (but be sure to read more first):

    bash <(curl -Ls http://git.io/eUx7rg)
    

    This will install and configure everything automagically. The script is provided by MacMiniVault and is available on Github. More information about the mySQL install script on http://www.macminivault.com/mysql-yosemite/.

    0 讨论(0)
  • 2020-12-04 10:25

    you want fix it can edit file "/Applications/XAMPP/xamppfiles/xampp" with TextEdit.

    Look for text "$XAMPP_ROOT/bin/mysql.server start > /dev/null &"
    And add "unset DYLD_LIBRARY_PATH" on top of it. It should look like:

    unset DYLD_LIBRARY_PATH
    $XAMPP_ROOT/bin/mysql.server start > /dev/null &

    hope can help you

    0 讨论(0)
  • 2020-12-04 10:29

    In my case I fixed it doing a little permission change:

    sudo chown -R _mysql:_mysql /usr/local/var/mysql
    sudo mysql.server start
    

    I hope it helps somebody else...

    Note: As per Mert Mertin comment:

    For el capitan, it is sudo chown -R _mysql:_mysql /usr/local/var/mysql

    0 讨论(0)
  • 2020-12-04 10:31

    Long story short you need to create a launch file. So, from Terminal:

    sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist

    (If you are not familiar with vi, then press i to start inserting text)

    This should be the content of your file:

    <?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>--user=mysql</string>
        </array>
      </dict>
    </plist>
    

    press esc then : wq!enter

    Then you need to give the file the right permissions and set it to load on startup.

    sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist 
    sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist 
    sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
    

    And that is it.

    0 讨论(0)
  • 2020-12-04 10:32

    The .pid is the processid of the running mysql server instance. It appears in the data folder when mysql is running and removes itself when mysql is shutdown.

    If the OSX operating system is upgraded and mysql is not shutdown properly before the upgrade,mysql quits when it started up it just quits because of the .pid file.

    There are a few tricks you can try, http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/ failing these a reinstall is needed.

    0 讨论(0)
  • 2020-12-04 10:32

    Try this:

    sudo mysqld_safe &
    
    0 讨论(0)
提交回复
热议问题