[root@hjx02 support-files]# mysqld_multi --defaults-extra-file=/etc/my.cnf start 2,3,4 WARNING: Log file disabled. Maybe directory or file isn't writable? mysqld_multi log file version 2.16; run: 一 4月 2 14:38:02 2018 Starting MySQL servers [root@hjx02 support-files]# 2018-04-02T06:38:02.438718Z mysqld_safe Logging to '/alidata/mysql/data2/hjx02.err'. Logging to '/alidata/mysql/data2/hjx02.err'. 2018-04-02T06:38:02.454909Z mysqld_safe Logging to '/alidata/mysql/data3/hjx02.err'. Logging to '/alidata/mysql/data3/hjx02.err'. 2018-04-02T06:38:02.472418Z mysqld_safe Logging to '/alidata/mysql/data4/hjx02.err'. Logging to '/alidata/mysql/data4/hjx02.err'. 2018-04-02T06:38:02.572185Z mysqld_safe Starting mysqld daemon with databases from /alidata/mysql/data2 2018-04-02T06:38:02.585735Z mysqld_safe Starting mysqld daemon with databases from /alidata/mysql/data3 2018-04-02T06:38:02.610249Z mysqld_safe Starting mysqld daemon with databases from /alidata/mysql/data4 [root@hjx02 support-files]# mysqld_multi --defaults-extra-file=/etc/my.cnf report WARNING: Log file disabled. Maybe directory or file isn't writable? mysqld_multi log file version 2.16; run: 一 4月 2 14:39:16 2018 Reporting MySQL servers MySQL server from group: mysqld2 is running MySQL server from group: mysqld3 is running MySQL server from group: mysqld4 is running
进入每个实例只有要修改密码并创建关闭账号
在mysql5.7里用户名与密码不能一样,否则会报错。
CREATE USER 'hjx'@'localhost' IDENTIFIED BY '123456'; GRANT SHUTDOWN ON *.* TO 'hjx'@'localhost'; flush privileges; [root@hjx02 data2]# mysql -S /tmp/mysql.sock3 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE USER 'hjx'@'localhost' IDENTIFIED BY '123456'; Query OK, 0 rows affected (0.01 sec) mysql> GRANT SHUTDOWN ON *.* TO 'hjx'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> exit Bye
关闭实例 [root@hjx02 init.d]# mysqld_multi --defaults-extra-file=/etc/my.cnf stop 2 WARNING: Log file disabled. Maybe directory or file isn't writable? mysqld_multi log file version 2.16; run: 一 4月 2 15:12:44 2018 Stopping MySQL servers [root@hjx02 init.d]# mysqladmin: [Warning] Using a password on the command line interface can be insecure. 2018-04-02T07:12:46.467832Z mysqld_safe mysqld from pid file /alidata/mysql/data2/hjx02.pid2 ended [root@hjx02 init.d]# vi /etc/my.cnf [root@hjx02 init.d]# mysqld_multi --defaults-extra-file=/etc/my.cnf stop 3 WARNING: Log file disabled. Maybe directory or file isn't writable? mysqld_multi log file version 2.16; run: 一 4月 2 15:15:54 2018
Stopping MySQL servers [root@hjx02 init.d]# mysqladmin: [Warning] Using a password on the command line interface can be insecure. 2018-04-02T07:15:55.934832Z mysqld_safe mysqld from pid file /alidata/mysql/data3/hjx02.pid3 ended