docker部署mysql5.7后登录时出现Access denied for user 'root'@'localhost' (using password: YES)的解决方法
1、先进去容器中安装vim工具
docker exec -it mysql bash
apt-get update
apt-get -y install vim
2、修改/etc/mysql/conf.d/docker.cnf文件,添加:skip-grant-tables
[mysqld]
skip-host-cache
skip-name-resolve
skip-grant-tables
3、退出,重启mysql容器
docker restart mysql
4、再次进入容器mysql -uroot -p进入mysql后
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update mysql.user set authentication_string = password("root1234") where user="root";
Query OK, 2 rows affected, 1 warning (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 1
mysql> exit
5、删除/etc/mysql/conf.d/docker.cnf文件中添加的skip-grant-tables,再重启容器
6、再次进入mysql就正常了。
参考:https://blog.csdn.net/weixin_48226988/article/details/112681407
docker部署mysql5.7后登录时出现Access denied for user 'root'@'localhost' (using password: YES)的解决方法的更多相关文章
- 【转载】在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码
在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码 2018年08月 ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...
- linux下mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
最近登录某台服务器的mysql时候总报错: Access[root@log01 ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Acc ...
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法
1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...
- 在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问,并可修改MySQL密码
这两天装了一个mysql 5.7数据库,但是在本地dos登陆不上去,报错Access denied for user 'root'@'localhost'(using password:YES): 也 ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法
使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 文件内容: [client]host = localhostuser = debian-sys-maint ...
- 最新 mysql登录报错“Access denied for user 'root'@'localhost' (using password: NO”的处理方法
1.关闭正在运行的MySQL.2.打开DOS窗口,转到mysql\bin目录.3.输入mysqld --skip-grant-tables回车.如果没有出现提示信息,那就对了.(正常的情况是光标闪烁没 ...
- MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
问题描述 安装完MySQL5.5数据库,使用Navicat Premium以及命令窗口连接数据库都报以下错误: ERROR 1045 (28000): Access denied for user ' ...
- MySQL登录报错"Access denied for user 'root'@'localhost' (using password: YES)"
最近登录MySQL时候总报错: # mysql -uroot -p Enter password: ERROR (): Access denied for user 'root'@'localhost ...
- mac下安装mysql5.7.18,连接出现Access denied for user 'root'@'localhost' (using password: YES)
mac下,mysql5.7.18连接出错,错误信息为:Access denied for user 'root'@'localhost' (using password: YES) ()里面的为she ...
随机推荐
- 考勤运行提示‘Length of values (115) does not match length of index (116) >>> ’
源码 df['餐补'] = money_list 解决思路: 1.分别打印输出两个字段长度 本来以为是每个月的文件格式不一致导致有的文件好用有的文件不好用 经过耐心查看代码 前面的算法统计有一个本应该 ...
- leaflet生成地图封装成jquery插件使用
公司业务里一直都有使用leaflet地图插件来做地图展示.绘图等操作.公司有个项目已经有好几年了,由于项目原因一直在使用,今年由于google 地图 api过期,导致已经使用的地图无法加载.我作为现在 ...
- MySql 主从(备)部署 | 冷备份
前言 MySQL 主从复制(Master-Slave Replication)是一种常见的数据库架构设计,用于提高数据可用性.实现读写分离以及支持备份策略.冷备份是指在数据库关闭状态下进行的数据备份方 ...
- mdn拾遗-- 纯html+css实现的input的验证
关于input的验证,其实从很古老的前端时代开始就一直采用一种比较可靠的方式,就是js操作dom,今天浏览mdn时发现了h5的验证方法,很是兴奋.感觉值得一记. 说在前面的话,着重就是配合h5 + c ...
- kubelet.service: Failed with result 'exit-code'.
检查kubelet服务状态 systemctl status kubelet 检查journal日志 journalctl 的 -u 参数可以指定服务进行过滤,这样可以屏蔽 ...
- Momentum Contrast for Unsupervised Visual Representation Learning论文精读
目录 Birth of MoCo Supervised Learning Contrastive Learning MoCo Dictionary Limits of the early learni ...
- BUUCTF---rsa_output
题目 点击查看代码 {21058339337354287847534107544613605305015441090508924094198816691219103399526800112802416 ...
- RAGflow搭建text-to-sql的AI研发助手
一.概述 text-to-sql 技术允许用户通过自然语言提问,系统自动将其转换为 SQL 语句并执行,大大降低了数据查询的门槛,提高了工作效率. text-to-sql 技术在数据分析.智能客服.数 ...
- Google发布A2A开源协议:“MCP+A2A”成未来标配?
就在刚刚Google Cloud Next 25大会上,谷歌重磅开源Agent2Agent(A2A)协议,这项被类比为"AI界的HTTP协议"的技术标准,彻底打破了智能体间的信息孤 ...
- 《数组》--DAY1--二分查找
分治算法--二分查找(返回下标) 1.定义:在有序列表中,每次查找范围折半 列表若存在重复元素,返回下标不唯一 优点:比较次数少,速度快,性能好:缺点:要求列表有序 注意区分while(left &l ...