首页 > 数据库 > MySQL > 正文

mysql_config_editor用法示例

2022-07-28 22:41:28
字体:
来源:转载
供稿:网友
        mysql_config_editor是一种存储mysql登录信息的工具。
 
      通过mysql_config_editor设置了登录信息后,在用mysql命令登录数据库时就可以只用加一个--login-path=name的参数,
  
举例如下:
 
     正常登陆为:
 
     # mysql -uroot -p'123456' --socket=/tmp/mysql.sock
  
     配置config_editor:
 
#mysql_config_editor set --login-path=9527 --socket=/tmp/mysql.sock --user=root --password
 
Enter password:      --此时输入123456
  
Oracle is a registered trademark of Oracle Corporation and/or its
 
affiliates. Other names may be trademarks of their respective
 
owners.
  
Connection id:          66820
 
Current database:
 
Current user:           root@localhost
 
SSL:                    Not in use
 
Current pager:          stdout
 
Using outfile:          ''
 
Using delimiter:        ;
 
Server version:         8.0.13 MySQL Community Server - GPL
 
Protocol version:       10
 
Connection:             Localhost via UNIX socket
  
Threads: 2  Questions: 266  Slow queries: 0  Opens: 380  Flush tables: 2  Open tables: 352  Queries per second avg: 0.003

(编辑:错新网)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表