Docker忘记mysql密码重置步骤

Mysql5.6版本以下的
1、docker exec -it sysdb bash 先进入随便一个数据库的实例
docker exec -it db002 /bin/sh

2、vi /etc/mysql/conf.d/docker.cnf 增加“忘记密码启动”模式:skip-grant-tables
可能会出现没装vi工具
(安装vi 工具2.1:docker exec -it mysql bash 2.2、mv /etc/apt/sources.list /etc/apt/sources.list.bak &&
echo “deb http://mirrors.163.com/debian/ jessie main non-free contrib” >/etc/apt/sources.list &&
echo “deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib” >>/etc/apt/sources.list &&
echo “deb-src http://mirrors.163.com/debian/ jessie main non-free contrib” >>/etc/apt/sources.list &&
echo “deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib” >>/etc/apt/sources.list 2.3: apt-get update && apt-get install vim -y)
[mysqld]
skip-host-cache
skip-name-resolve
skip-grant-tables

3、退出Docker

你可能感兴趣的:(java)