How to stop mysqld

前端 未结 18 848
清酒与你
清酒与你 2020-12-04 04:32

To find out the start command for mysqld (using a mac) I can do:

ps aux|grep mysql

I get the following output, which allows me to start mys

相关标签:
18条回答
  • Kill is definitly the wrong way! The PID will stay, Replicationsjobs will be killed etc. etc.

    STOP MySQL Server

    /sbin/service mysql stop

    START MySQL Server

    /sbin/service mysql start

    RESTART MySQL Server

    /sbin/service mysql restart

    Perhaps sudo will be needed if you have not enough rights

    0 讨论(0)
  • 2020-12-04 05:14

    For MAMP

    1. Stop servers (but you may notice MySQL stays on)
    2. Remove or rename /Applications/MAMP/tmp/mysql/ which holds the mysql.pid and mysql.sock.lock files
    3. When you go back to Mamp, you'll see MySQL is now off. You can "Start Servers" again.
    0 讨论(0)
  • 2020-12-04 05:15

    For Windows, you can run this command directly if mysql/bin is in your path.

    mysqladmin -u root -p shutdown
    
    0 讨论(0)
  • 2020-12-04 05:15

    What worked for me on CentOS 6.4 was running service mysqld stop as the root user.

    I found my answer on nixCraft.

    0 讨论(0)
  • 2020-12-04 05:15

    To stop MariaDB and MySQL server instance:

    sudo mysqladmin shutdown
    

    To start MariaDB and MySQL server instance:

    mysqld &
    

    To change data ownership for MariaDB and MySQL server instance:

    sudo chown -R 755 /usr/local/mariadb/data
    
    0 讨论(0)
  • 2020-12-04 05:20

    Try:

    /usr/local/mysql/bin/mysqladmin -u root -p shutdown 
    

    Or:

    sudo mysqld stop
    

    Or:

    sudo /usr/local/mysql/bin/mysqld stop
    

    Or:

    sudo mysql.server stop
    

    If you install the Launchctl in OSX you can try:

    MacPorts

    sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
    sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql.plist
    

    Note: this is persistent after reboot.

    Homebrew

    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    

    Binary installer

    sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
    sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
    

    I found that in: https://stackoverflow.com/a/102094/58768

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