mysql config type_mysql_config_editor用法举例
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 type_mysql_config_editor用法举例相关推荐
- 【node】express中mysql的基本用法、连接池的使用、事务的回滚
[node]express中mysql的基本用法.连接池的使用 安装mysql包 mysql的配置信息 mysql基本操作 查询mysql并渲染数据 mysql插入操作 首先在html页面写上< ...
- MySQL:讨人喜欢的 MySQL replace into 用法(insert into 的增强版)
讨人喜欢的 MySQL replace into 用法(insert into 的增强版) 在向表中插入数据的时候,经常遇到这样的情况:1. 首先判断数据是否存在: 2. 如果不存在,则插入:3.如果 ...
- sequence.pad_sequences 的用法举例
sequence.pad_sequences 的用法举例_power的专栏-CSDN博客
- Linux下Mysql的查询用法
Linux下Mysql的查询用法 一.Mysql的delete删除语法 1.删除数据库 2.删除数据库的表 二.查询数据 1.基本查询 2.条件查询 三.数据库插入数据 1.创建新表 2.插入数据 四 ...
- 【转】awk 里的substr函数用法举例
awk 里的substr函数用法举例: 要截取的内容: 2007-08-04 04:45:03.084 - SuccessfulTradeResult(status: 1, currencyPair: ...
- linux nc命令用法举例
nc命令用法举例 什么是nc nc是netcat的简写,有着网络界的瑞士军刀美誉.因为它短小精悍.功能实用,被设计为一个简单.可靠的网络工具 nc的作用 (1)实现任意TCP/UDP端口的侦听,nc可 ...
- MySQL replace into 用法
MySQL replace into 用法(insert into 的增强版) 在向表中插入数据的时候,经常遇到这样的情况:1. 首先判断数据是否存在: 2. 如果不存在,则插入:3.如果存在,则更新 ...
- Mysql临时表的用法 - 51CTO.COM
Mysql临时表的用法 - 51CTO.COM Mysql临时表我们经常会用到,下面就为您详细介绍Mysql临时表的用法,供您参考,如果您对此方面感兴趣的话,不妨一看. 当工作在非常大的表上时,你可能 ...
- html post举例,html post请求之a标签的两种用法举例
html post请求之a标签的两种用法举例 1.使用ajax来发起POST请求 HTML代码如下:发起POST请求a> JQuery代码如下:$(".a_post").on ...
最新文章
- Mysql是时候学习一个存储过程了
- Science:最新发现哈希可能是大脑的通用计算原理!
- 20行python代码的入门级小游戏-用Python设计一个经典小游戏
- VS_自动添加头文件
- qimage加载bmp图片_批量修改图片大小,我发现了最简单的方法!
- 1332: 生日日数
- ASP.NET中的数据绑定:哪个更快? (转)
- 深度学习在自然语言处理的应用(Version 0.76)
- oracle:oracle学习笔记(四)循环、光标、异常、瀑布模型
- ubuntu opencv4 需要的依赖
- centos mysql server_Centos 7 下载安装 mysql server 5.6 (亲测可用)
- 大数据如何进行创新与变革
- 在css表格怎么居中对齐,css居中和对齐方法集锦
- 音频驱动不支持您的计算机硬件,声卡驱动装不上导致电脑没声音怎么办?
- 网安面试题(common)
- php怎么压缩文件夹,PHP压缩文件夹 php
- mysql多数据表关联查询慢问题解决方案
- 简记_ LDO基础知识
- 2020年华为杯第十七届中国研究生数学建模竞赛---回顾记录
- 少壮不努力,一生在内地
热门文章
- 测测实际带宽,预防使用“假带宽”
- 僵尸矩阵 · Zombie in Matrix
- 9-5 一致性哈希分区
- python3写文件_python3 写文件问题
- 【写作技巧】毕业设计的附录放在论文的哪个位置?
- 套壳python_“完全自主设计、开发和实现”的编程语言,被指是Python的套壳产品?...
- flink源码分析_Flink源码分析之深度解读流式数据写入hive
- mysql.8.0.13ZIP安装教程_关于mysql 8.0.13zip包安装方法
- c mysql linux,linux上C语言连接mysql
- java抽象方法特点_java-抽象类的特点