mysql_config_editor是一种存储mysql登录信息的工具。 通过mysql_config_editor设置了登录信息后,在用mysql命令登录数据库时就可以只用加一个--login-path=name的参数, 而不用再输入host,user,password等信息登陆。 举例如下: 正常登陆为: # 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 打印config_editor信息: #mysql_config_editor print --all [9527] user = root password = ***** socket = /tmp/mysql.sock 用mysql --login-path登陆: #mysql --login-path=9527 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 66820 Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, 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>\s -------------- mysql Ver 8.0.13 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL) 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 Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /tmp/mysql.sock Uptime: 23 hours 41 min 42 sec Threads: 2 Questions: 266 Slow queries: 0 Opens: 380 Flush tables: 2 Open tables: 352 Queries per second avg: 0.003 -------------- mysql>quit Bye reset 删除config_editor日志的所有内容 # mysql_config_editor reset 开发shell脚本时不提示密码方法: # cd ~ # vim .my.cnf [client] user=root password=123456 直接敲mysql就能登陆,不需要输入密码: # mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 132246 Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, 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 >quit Bye
mysql_config_editor用法举例
来源:这里教程网
时间:2026-03-01 11:53:54
作者:
编辑推荐:
- mysql_config_editor用法举例03-01
- Oracle 认证下载03-01
- MySQL5.6 PERFORMANCE_SCHEMA 说明03-01
- Mysql入门教程第一讲:什么是MySQL?03-01
- Mysql replication check脚本03-01
- 如果将relay_log_recovery设置为0会发生什么?03-01
- 一份超详细的MySQL高性能优化实战总结03-01
- 关于mysql 5.7重置密码03-01
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- Oracle 认证下载
Oracle 认证下载
26-03-01 - Mysql入门教程第一讲:什么是MySQL?
Mysql入门教程第一讲:什么是MySQL?
26-03-01 - 一份超详细的MySQL高性能优化实战总结
一份超详细的MySQL高性能优化实战总结
26-03-01 - 关于mysql 5.7重置密码
关于mysql 5.7重置密码
26-03-01 - 2018 ACMUG全球年会盛典在京圆满落幕,开启数据库产业创新变革之路新征程(附PPT)
- MySQL数据备份之mysqldump使用
MySQL数据备份之mysqldump使用
26-03-01 - Innodb undo之 undo物理结构的初始化
Innodb undo之 undo物理结构的初始化
26-03-01 - 事故现场:MySQL 中一个双引号的错位引发的血案
事故现场:MySQL 中一个双引号的错位引发的血案
26-03-01 - mysql innodb double write概念汇总
mysql innodb double write概念汇总
26-03-01 - 巧用这19条MySQL优化,效率至少提高3倍
巧用这19条MySQL优化,效率至少提高3倍
26-03-01
