mysql關閉:
https://dev.mysql.com/doc/mysql-startstop-excerpt/8.0/en/server-shutdown.html
mysqladmin shutdown
example:
./mysqladmin -uroot -p.... shutdown --socket=/home/mysql/data3306/mysql3306.sock
or
/etc/init.d/mysqld stop
systemctl mysqld stop
or
kill
啓動的幾種方式:
https://dev.mysql.com/doc/mysql-startstop-excerpt/8.0/en/programs-server.html
mysqld_safe — MySQL Server Startup Script
mysqld_safe is the recommended way to start a mysqld server on Unix. mysqld_safe adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log. A description of error logging is given later in this section.
mysqld_safe reads all options from the [mysqld]
, [server]
, and [mysqld_safe]
sections in option files. For example, if you specify a [mysqld]
section like this
example:
/bin/sh ./mysqld_safe --basedir=/home/mysql/mysql --datadir=/home/mysql/data3306 --port=3306 --socket=/home/mysql/data3306/mysql3306.sock &
4.4 mysqld_multi — Manage Multiple MySQL Servers
mysqld_multi is designed to manage several mysqld processes that listen for connections on different Unix socket files and TCP/IP ports. It can start or stop servers, or report their current status.
example:
/etc/init.d/mysqld_multi start