- shut down the database directly under single instance
- the process of killing the corresponding instance in multiple instances , such as 3306
[[Email protected] ~]# PS aux |grep mysql
Root 10384 0.0 0.0 106244 1416? S 18:48 0:00/bin/sh/usr/local/mysql/bin/mysqld_safe--defaults-file=my.cnf
MySQL 11370 0.0 29.8 1061116 567060? Sl 18:48 0:09/usr/local/mysql/bin/mysqld--defaults-file=my.cnf--basedir=/usr/local/mysql--datadir=/data/mysql/ 3307/data--plugin-dir=/usr/local/mysql/lib/plugin--user=mysql--log-error=/data/mysql/3307/mysqld_3307.err-- open-files-limit=1024--pid-file=/data/mysql/3307/mysqld.pid--socket=/data/mysql/3307/mysql.sock--port=3307
Root 12618 0.0 0.0 106248 1472? S 19:27 0:00/bin/sh/usr/local/mysql/bin//mysqld_safe--defaults-file=/data/mysql/3306/my.cnf
MySQL 14472 0.0 6.5 637228 125068? Sl 21:58 0:03/usr/local/mysql/bin/mysqld--defaults-file=/data/mysql/3306/my.cnf--basedir=/usr/local/mysql-- Datadir=/data/mysql/3306/data--plugin-dir=/usr/local/mysql/lib/plugin--user=mysql--log-error=/data/mysql/3306/ Mysqld_3306.err--open-files-limit=48--pid-file=/data/mysql/3306/mysqld.pid--socket=/data/mysql/3306/mysql.sock --port=3306
Root 15038 0.0 0.0 103316 832 pts/1 s+ 23:50 0:00 grep mysql
[[email protected] ~]# kill 14472
- Restart with command
[Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--defaults-file=/data/mysql/3306/my.cnf--skip-grant-table &
[Email protected] ~]# mysql-s/data/mysql/3306/mysql.sock
mysql> UPDATE user SET Password=password (' zckj.com ') WHERE user= ' root ';
Query OK, 0 rows Affected (0.00 sec)
mysql> FLUSH privileges;
Query OK, 0 rows Affected (0.00 sec)
Note: The--skip-grant-table parameter under multiple instances must be started behind the MY.CNF parameter
- after normal exit, re-start normally, or take the--skip-grant-table parameter
MySQL failure--forgot how to retrieve the password