docker 安装mysql容器


docker run -p 3307:3306 --name mysql-container -v /www/mysql/slave/log:/var/log/mysql -v /www/mysql/slave/data:/var/lib/mysql -v /www/mysql/slave/config/my.cnf:/etc/my.cnf -e MYSQL_ROOT_PASSWORD=Wenchen@xuan05186316 -e identified=mysql_native_password -d mysql:8.0.24
docker exec -it mysql-container

use mysql;
update user set host='%' where user='root' ;

grant all privileges on *.* to 'root'@'%' ;

flush privileges ;

select host from user where user='root';


alter user 'root'@'%' identified with mysql_native_password by 'Wenchen@xuan05186316';


select host, user, authentication_string, plugin from user


alter user 'root'@'%' identified with mysql_native_password by '123456';


docker run -d --name mysql-container -e MYSQL_ROOT_PASSWORD=123456  -p 3307:3306 -e identified=mysql_native_password mysql:8.0.24

相关推荐

  1. docker 安装mysql容器

    2023-12-15 16:08:05       36 阅读
  2. Docker 安装PostgreSQL容器

    2023-12-15 16:08:05       17 阅读
  3. dockerdocker安装Mysql

    2023-12-15 16:08:05       33 阅读
  4. 虚拟机安装docker容器

    2023-12-15 16:08:05       16 阅读
  5. 在ubuntu安装Docker容器

    2023-12-15 16:08:05       10 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-15 16:08:05       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-15 16:08:05       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-15 16:08:05       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-15 16:08:05       20 阅读

热门阅读

  1. python中qt5的入门

    2023-12-15 16:08:05       38 阅读
  2. 某60内网渗透之DNS隧道通信初探-dnscat2与C&C

    2023-12-15 16:08:05       38 阅读
  3. 【Linux】多线程相关问题

    2023-12-15 16:08:05       40 阅读
  4. 鸿蒙arkTs Toast抽取 及使用

    2023-12-15 16:08:05       40 阅读
  5. 常用的调试方法(段错误产生原因)

    2023-12-15 16:08:05       41 阅读