MySQL_config_editor 帮助信息请查看 man mysql_config_editor 或 mysql_config_editor -?...或 mysql_config_editor set -?...如: mysql_config_editor set -G mypath -u root -p -S /u01/data/mysql5.7.25/mysql.sock mysql_config_editor...--all mysql_config_editor print -G user1 [root@mysql1 ~]# mysql_config_editor print --all [client] #...文件已被清空 使用 login path mysql --login-path=mypath mysqladmin --login-path=mypath [root@mysql1 ~]# mysqladmin
本文来源:原创投稿 *爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。...即执行完就退出登录,不需要交互,我们经常在脚本中这样使用。那么同样的,在维护 InnoDB Cluster 时,怎么在脚本中调用 mysql shell 查看 MGR 集群的状态或者对集群做操作呢?...,通常是因为没有安装 mysql_config_editor,因为 mysql shell 的密码保存实际也是用 mysql_config_editor 实现的,下面会解释道具体用法。...保存的密码,所以也可以用 mysql_config_editor print --all 查看 ,与上面输出的连接串一一对应: [root@10-186-63-93 ~]# mysql_config_editor...[Y]es/[N]o/Ne[v]er (default No):Y 也可以通过 mysql_config_editor set 来保存指定连接串的密码: mysql_config_editor set
mycli.gif 具体的用法,参照官方文档: 文档 github仓库 以下说明操作多个数据库的方式: 使用mysql自带的mysql_config_editor储存连接信息: mysql_config_editor...set --login-path=localhost --user=senlong --password --host=localhost --port=3306 Enter password: mysql_config_editor...mycli操作数据表.png 显示所有的连接信息: $ mysql_config_editor print --all [localhost] user = senlong password = ***...= localhost port = 3306 [test2] user = test2 password = ***** host = localhost port = 3306 删除某个连接: mysql_config_editor
version:mysql8.0.28背景:对于一个经常忘记密码,或密码特别繁琐或脚本里输入密码都是很不方便的,可以使用免密登录一.配置my.cnfmysql的配置参数文件类型有mysqld,mysql...client]对应所有客户端程序;将用户的账号和密码放在[client]组里,如[client]user=rootpassword=666666重启mysqld服务,直接mysql可以登录客户端缺陷:密码使用的是明文...,安全性没有保障图片二.使用mysql_config_editor工具mysql_config_editor会在用户家目录下生成.mylogin.cnf的配置文件,该配置文件会分成若干组,每个组对应一个用户的登录路径...socketmysql_config_editor set --login-path=cc --user=root --passwordEneter password:(输入密码)find ~ -name .mylogin.cnf #查看配置文件mysql_config_editor
5.6后推出了 mysql_config_editor 这个命令,本地加密存储用户的密码,通过指定登录文中的某一个 MySQL而不用输入密码进行登录。...使用方法: mysql_config_editor set --login-path=登录实例的名字 --host=ip --user=用户名 --password 输入密码即可。...具体如下: #mysql_config_editor set --login-path=3306 --host=127.0.0.1 --port=3306 --user=wubx --password...Enter password: #mysql_config_editor print --all [3306] user = wubx password = ***** host = 127.0.0.1...wubx@127.0.0.1:3306 [(none)]> 更多操作查看: mysql_config_editor --help 命令行执行 SQL 通过命令行执行 SQL 方法有多种,以下三种较为常见
使用起来十分方便....只需要指定名称即可连接到指定服务器, 比如 mysql --login-path=root 配置也比较简单, 可使用如下命令配置 mysql_config_editor set --login-path...要使用变量的话, 可以转为HEX 保存....mysql_config_editor print --all 来查看的, 但密码是加密的....那mysql_config_editor还安全么....
而在MySQL中自5.6版本开始可以使用--login-path来实现。...先来看看Oracle中的wallet实现无密码登录,可以通过mkstore来配置,我们可以使用--help得到命令使用的帮助。...MySQL来实现,则需要通过mysql_config_editor来配置。...mysql_config_editor的命令提示如下,可以看出可使用的选项还是相对比较简单的。...[mysql@oel1 ~]$ mysql_config_editor set --help mysql_config_editor Ver 1.0 Distrib 5.6.23, for linux-glibc2.5
但是,该方式默认使用的/etc/my.cnf配置文件下的信息,因此需要调整该目录下的对应标签下的信息 vim /etc/my.cnf /** 添加如下信息 */ [client] user="root.../etc/my.cnf #[client] #user="root" #password="123456" [mysql] user="root" password="123456" /** 使用...2.2 添加在login_path 使用mysql_config_editor 命令添加需要免密登录的用户,如下 /** 添加用户 */ /usr/local/mysql5.7/bin/mysql_config_editor...-S /app/data/mysql3307/tmp/mysql.sock Enter password: /** 查看添加的用户信息 */ /usr/local/mysql5.7/bin/mysql_config_editor...注意: 如果密码中含有字母、数字、下划线外的字符,mysql_config_editor set最后输入密码时添加上引号。
HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) 解答: 因为开启了使用...解答: 使用 mysql_config_editor set --login-path=local --host=192.168.1.190 --user=zabbix --password 然后输入zabbix...用户的密码 登陆时使用: mysql --login-path=local -e "show databases;" 有sockfang方式登陆使用: mysql --login-path=local...--socket=/ops/data/mysql/mysqld.sock -e "show databases;" 删除 mysql_config_editor remove --login-path=...remote mysql_config_editor print --all 导入数据到数据库报错ERROR 1050 ERROR 1050 (42S01) at line 1: Table ‘users
方法二:mysql_config_editor工具 该工具的官方解释为:configure authentication information for connecting to MySQL server...举个栗子(哈哈)吧: #1 配置,命令回车后输入密码 mysql_config_editor set --login-path=dba_test --host=localhost --user=root...--password #2 查看 mysql_config_editor print --all #3 登录 mysql --login-path=dba_test 这个命令就可以放心写入你的各种运维脚本
解决方法:用 mysql_config_editor 生成登录密钥。...mysql_config_editor set --login-path=mydb --host=localhost --user=test --password 回车输入密码后,会生成一个名为 mydb
我们都知道使用MySQL客户端来访问MySQL数据库时,会以一定的顺序读取不同位置的配置文件,但在一次做测试时,发现除了按照顺序读取默认的配置文件路径外,MySQL还有额外的读取配置文件的行为。...一、场景现象 在本地做测试时,发现一个奇怪的现象,当使用socket打算登录数据库,发现不指定用户时,默认并不是用的root用户登录,而是被修改为了bisal用户, [root@test ~]# mysql...9、排查 /root/.mylogin.cnf 看到这个文件我们一般都知道,这个是mysql_config_editor工具用来配置login-path的生成的文件,我们可以用以下方式查看当前的配置信息..., [root@test ~]# mysql_config_editor print --all [client] user = "bisal" password = ***** host = "127.0.0.1...这案例可能比较特殊,尤其是测到mysql_config_editor场景,但是这种排查问题的逻辑,通过指令"mysql --verbose --help|grep my.cnf",找到本机的默认配置文件顺序
- free 列显示还有多少物理内存和交换空间可用使用。- shared 列显示被共享使用的物理内存大小。- buff/cache 列显示被 buffer 和 cache 使用的物理内存大小。...VIRT=SWAP+RES- SWAP 进程使用的虚拟内存中,被换出的大小,单位kb // 将不常用的内存交换到磁盘,提高物理内存使用性能和空间- RES 进程使用的、未被换出的物理内存大小,单位kb。...- VSZ: 虚拟容量:整个进程的虚拟内存使用(kb)- RSS: 长期内存使用:任务的不可交换物理内存的使用量(kb)- %MEM: 该进程使用内存的百分比- Command: 拉起进程对应的命令-...通过借助mysql_config_editor工具将登陆MySQL服务的认证信息加密保存在.mylogin.cnf文件(默认位于用户主目录) 。...mysql_config_editor使用帮助:配置:mysql_config_editor set --login-path=test --user=test_user --host=127.0.0.1
三、人间大炮二级准备:MYSQL_PWD,mysql_config_editor解决 还好,有一些其他的解决方案也可以解决这个问题。...mysql_config_editor 利用mysql_config_editor来保存用户名密码,避免输出Warning信息 mysql_config_editor set --login-path=...5.1 删除汇编中Warning信息 Andrew McGill使用的是perl,解决方案如下 perl -p -i -e 's/(Warning: Using a password on the command
前言: 在日常使用数据库的过程中,难免会遇到需要修改账号密码的情景,比如密码太简单需要修改、密码过期需要修改、忘记密码需要修改等。本篇文章将会介绍需要修改密码的场景及修改密码的几种方式。...使用 alter user 修改 比如如果想更改 testuser 账号的密码,我们可以使用 root 账号登录,然后执行 alter user 命令更改 testuser 账号的密码。...同样是使用 root 账号可修改其他账号的密码。...通过借助 mysql_config_editor 工具将登陆 MySQL 服务的认证信息加密保存在 .mylogin.cnf 文件(默认位于用户主目录)。...假设我们想配置 root 账号在本地快捷登录,可以这么做:# 执行回车后需要输入一次root密码 [root@host ~]# mysql_config_editor set –login-path=root
本文主要说明了Centos下Logrotate的使用和配置的方法。 Logrotate配置文件在哪儿? Logrotate的配置文件位于 /etc/logrotate.conf。...如何使用 我们先试用帮助命令看一下,其中老高想强调的是 -d,其翻译为什么都不做,仅仅是测试,这个参数很大程度方便了我们测试配置文件而不用担心当前的配置出差错。...的计划任务配置 再此我们使用cat命令检查/etc/cron.daily/logrotate的存在,并确认文件内容没有被修改。...Use mysql_config_editor(1) to store # authentication credentials in the encrypted login path file # ~.../.mylogin.cnf # # Example usage: # # mysql_config_editor set --login-path=client --user=root --host=
本文来源:原创投稿*爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。...---我们都知道使用 mysql 客户端去访问 MySQL 数据库时,会以一定的顺序去读取不同位置的配置文件,但在一次做测试时,发现除了按照顺序读取默认的配置文件路径外,mysql 还有额外的读取配置文件的行为...与我们的验证结果一致第6行输出,增加了一个对/root/.mylogin.cnf的读取操作,并且可以知道当前这个文件是确实存在的9、排查 /root/.mylogin.cnf看到这个文件我们一般都知道,这个是 mysql_config_editor...工具用来配置 login-path 的生成的文件,我们可以用以下方式查看当前的配置信息[root@10-186-61-162 ~]# mysql_config_editor print --all[client...这里可以看到配置中有一个 client 标签的连接参数配置,配置的内容正好是我们文章开头显示的异常默认值,到这我们基本定位了造成这个奇怪现象的原因,出现这个故障场景的原因也是刚好这台是测试环境曾经做过一些 mysql_config_editor
可以单独使用 在文件内添加下面命令行,然后重启 -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT # service...2、采用命令导出和导入数据库 其实在这个时候,我们如果采用”详解使用mysqldump命令备份还原MySQL数据用法整理http://www.laozuo.org/5047.html“介绍的方法也是可以使用的...登陆数据库 # mysql -u root -p 7.2、利用mysql_config_editor 1、设置加密模式 mysql_config_editor set --login-path=local
---背景最近在使用脚本新建了一批应用用户,发现一个奇怪的问题,有部分用户存下以下问题:应用使用该密码能正常访问,但使用 mysql 客户端登录手动输入密码无法登录。...经过与正常用户对比发现存在登录异常的用户使用了特殊字符"$"。问题复现在测试环境使用脚本生成一批用户#新建用户脚本简化后如下#!...我们知道在 shell 中使用单引号与双引号定义的字符串是有区别的。...mysql> create user app2@'%' identified by '123#abc';Query OK, 0 rows affected (0.01 sec)[root@node3 ~]# mysql_config_editor...Access denied for user 'app2'@'127.0.0.1' (using password: YES)#规避这个bug也很简单,配置时输入密码加上双引号[root@node3 ~]# mysql_config_editor
本文来源:原创投稿 * 爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。...可以进行一次设置,多次安全使用。...使用方法如下:设置一个 login_path ,名字为 user_ytt ,密码按提示输入即可。...root@ytt-ubuntu18:/home/ytt# mysql_config_editor set -G user_ytt -S /var/run/mysqld/mysqld.sock -u ytt...---------+ root@ytt-ubuntu18:/home/ytt# mysqladmin --login-path=user_ytt ping mysqld is alive mysql_config_editor
领取专属 10元无门槛券
手把手带您无忧上云