温州专业网站制作设计,app制作平台神医嫡女漫画,莲湖免费做网站,做网站好参考文档#xff1a; https://mysql.net.cn/doc/refman/8.0/en/mysql-config-editor.html
OS上分别有2套库#xff0c;设置后#xff0c;通过不使用密码来登录#xff0c;类似postgres的.pgpass文件
-- 执行一下命令#xff0c;会要求提示输入密码
mysql_config_edit…参考文档 https://mysql.net.cn/doc/refman/8.0/en/mysql-config-editor.html
OS上分别有2套库设置后通过不使用密码来登录类似postgres的.pgpass文件
-- 执行一下命令会要求提示输入密码
mysql_config_editor set --login-path3306 --userroot --host127.0.0.1 --port3306 --password
mysql_config_editor set --login-path3307 --userroot --host127.0.0.1 --port3307 --password
-- 产生的.mylogin.cnf文件这是一个隐藏文件 而且不是文本格式的所以打开会是乱码
[rootredhat762100 ~]# more .mylogin.cnf
ԋuJ--通过print打印出分组3306分组3307以及所有的内容
[rootredhat762100 ~]# mysql_config_editor print --login-path3306
[3306]
user root
password *****
host 127.0.0.1
port 3306
[rootredhat762100 ~]# mysql_config_editor print --login-path3307
[3307]
user root
password *****
host 127.0.0.1
port 3307
[rootredhat762100 ~]#[rootredhat762100 ~]# mysql_config_editor print --all
[3306]
user root
password *****
host 127.0.0.1
port 3306
[3307]
user root
password *****
host 127.0.0.1
port 3307
[rootredhat762100 ~]#-- 通过免密码登录到3306库
[rootredhat762100 ~]# mysql --login-path3306
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.7.25-log MySQL Community Server (GPL)Copyright (c) 2000, 2019, 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.rootdb 15:27: [(none)]
-- 通过免密码登录到3307库
[rootredhat762100 ~]# mysql --login-path3307
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.7.25-log MySQL Community Server (GPL)Copyright (c) 2000, 2019, 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.rootdb 15:27: [(none)]END