Docker安装mysql

ou need to specify one of the following as an environment variable: - 图1

  1. 2023-04-16 13:03:32 You need to specify one of the following as an environment variable:
  2. 2023-04-16 13:03:32 - MYSQL_ROOT_PASSWORD
  3. 2023-04-16 13:03:32 - MYSQL_ALLOW_EMPTY_PASSWORD
  4. 2023-04-16 13:03:32 - MYSQL_RANDOM_ROOT_PASSWORD

laradock mysql 密码,laradock下mysql You need to specify one of MYSQLROOT_PASSWORD, MYSQL_ALLOW_EMPTY_P…陆雨知的博客-CSDN博客

解决办法:

ou need to specify one of the following as an environment variable: - 图2

修改密码

docker部署mysql5.7后登录时出现Access denied for user ‘root‘@‘localhost‘ (using password: YES)的解决方法_weixin_48226988的博客-CSDN博客

下面命令挨个儿试试

  1. update mysql.user set authentication_string = password('root') where user='root';
  2. UPDATE user SET Password = PASSWORD('root1') WHERE user = 'root';
  3. set password for root@localhost = password('root');
  4. SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');
  5. UPDATE user SET Password = PASSWORD('root') WHERE user = 'root';
  6. ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
  7. update user set host='%' where user='root';
  8. ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
  9. flush privileges;