MySQL管理多个实例的方法(2)

mysql    16773  15873  0 09:55 pts/0    00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/conf/my_3306.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/mysql_3306 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/mysql_3306/error.log --open-files-limit=65535 --pid-file=/data/mysql/mysql_3306/mysql.pid --socket=/tmp/mysql_3306.sock --port=3306

root      16875  12043  0 09:56 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/conf/my_3307.cnf

mysql    17775  16875  2 09:56 pts/0    00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/conf/my_3307.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/mysql_3307 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/mysql_3307/error.log --open-files-limit=65535 --pid-file=/data/mysql/mysql_3307/mysql.pid --socket=/tmp/mysql_3307.sock --port=3307

root      17800  12043  0 09:56 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/conf/my_3308.cnf

mysql    18700  17800  7 09:56 pts/0    00:00:01 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/conf/my_3308.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/mysql_3308 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/mysql_3308/error.log --open-files-limit=65535 --pid-file=/data/mysql/mysql_3308/mysql.pid --socket=/tmp/mysql_3308.sock --port=3308

root      18723  12043  0 09:56 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql/conf/my_3309.cnf

mysql    19623  18723  7 09:56 pts/0    00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/conf/my_3309.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/mysql_3309 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/mysql_3309/error.log --open-files-limit=65535 --pid-file=/data/mysql/mysql_3309/mysql.pid --socket=/tmp/mysql_3309.sock --port=3309

登录MySQL数据

# mysql -S /tmp/mysql_3306.sock

# mysql -S /tmp/mysql_3307.sock

# mysql -S /tmp/mysql_3308.sock

# mysql -S /tmp/mysql_3309.sock

4、关闭MySQL进程

mysqladmin shutdown -S /tmp/mysql_3306.sock

mysqladmin shutdown -S /tmp/mysql_3307.sock

mysqladmin shutdown -S /tmp/mysql_3308.sock

mysqladmin shutdown -S /tmp/mysql_3309.sock

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/c747ba27bb4f9635d365a20e6ec9f51f.html