3306:
[root@node01 ~]# cd /opt/data/
[root@node01 data]# ls
3306 3307 3308
[root@node01 data]# cat 3306/pass
NQlq&kJi-2D#
[root@node01 data]# mysql -uroot -p'NQlq&kJi-2D#' -S /tmp/mysql3306.sock #登录到3306设置密码
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.39
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> set password = password('1234563306');
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> exit
Bye
3307:
[root@node01 data]# cat 3307/pass
nsMj7wrS.)9G
[root@node01 data]# mysql -uroot -p'nsMj7wrS.)9G' -S /tmp/mysql3307.sock
mysql> set password = password('1234563307');
Query OK, 0 rows affected, 1 warning (0.00 sec)
3308:
[root@node01 data]# cat 3308/pass
h#qpvlQ%y5o;
[root@node01 data]# mysql -uroot -p'h#qpvlQ%y5o;' -S /tmp/mysql3308.sock
mysql> set password = password('1234563308');
Query OK, 0 rows affected, 1 warning (0.01 sec)
检验
登录3306
[root@node01 data]# mysql -uroot -p1234563306 -h127.0.0.1 -P3306
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.39 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> exit
Bye
3307:
[root@node01 data]# mysql -uroot -p1234563307 -h127.0.0.1 -P3307
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.39 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> exit
Bye
3308:
[root@node01 data]# mysql -uroot -p1234563308 -h127.0.0.1 -P3308
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.39 MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> exit
Bye