当前位置:网站首页>After installing mysql, docker entered the container and found that he could not log in to MySQL
After installing mysql, docker entered the container and found that he could not log in to MySQL
2022-07-27 08:07:00 【Fall in front of the programmer's gate】
1、 Modify the configuration file my.cnf, stay [mysqld] Add the following code
skip-grant-tables
2、 Restart container
docker restart Containers ID
3、 Into the container
docker exec -it Containers ID /bin/bash
# 4、 Sign in mysql
mysql -uroot
# 5、 Do the following
// Switch database
use mysql;
# Change encryption
update user set plugin='mysql_native_password' where user='root';
# Set the password
alter user 'root'@'localhost' IDENTIFIED BY '123456';
# Refresh permission table
flush PRIVILEGES;
# 6、 Comment out my.cnf Inside skip-grant-tables
# 7、 Restart container
docker restart Containers ID
边栏推荐
- Gossip: is rotting meat in the pot to protect students' rights and interests?
- 北京五日游记
- Shell scripts related
- Qt Creator代码风格插件Beautifier
- 软件调优方法有哪些?看看飞腾技术专家怎么说 | 龙蜥技术
- Combined use of C WinForm form form event and delegate
- Want the clouds in the picture to float? Video editing services can be achieved in three steps with one click
- Enhancement: BTE process introduction
- 大家节日快乐哈
- Dormitory access control system made by imitating the boss (III)
猜你喜欢

Design and development of GUI programming for fixed-point one click query

如何在 60 秒内去分析和定位问题?

如何更新pip3?和Running pip as the ‘root‘ user can result in broken permissions and conflicting behaviour

杂谈:把肉都烂在锅里就是保障学生权益了?

Enhancement: BTE process introduction

On data security

Dasctf2022.07 enabling game password WP

C# 事件用法案例 订阅事件+=

Comprehensive cases

I can't figure out why MySQL uses b+ trees for indexing?
随机推荐
如何获取广告服务流量变现数据,助力广告效果分析?
What are the software tuning methods? Let's see what Feiteng technology experts say about dragon lizard technology
代码接口自动化的有点
Leetcode54. Spiral matrix
kalibr标定realsenseD435i --多相机标定
Methods of server network testing
Development of three database general SQL code based on PG Oracle and MySQL
Enhancement: BTE process introduction
What is the real HTAP? (1) Background article
You may need an additional loader to handle the result of these loaders.
Usage scenarios for automated testing
Mqtt instruction send receive request subscription
Dormitory access control system made by imitating the boss (III)
C event usage case subscription event+=
My senior
QT creator code style plug-in beautifier
北京五日游记
二零二零年终总结
Comprehensive cases
Digital transformation driven by enterprise architecture!