docker启动mysql失败

root@ecs-kc1-small-1-linux:~# docker run -p 3306:3306 mysql:8-oracle
2022-03-05 13:40:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.28-1.el8 started.
2022-03-05 13:40:50+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-03-05 13:40:50+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.28-1.el8 started.
2022-03-05 13:40:50+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified
You need to specify one of the following:
- MYSQL_ROOT_PASSWORD
- MYSQL_ALLOW_EMPTY_PASSWORD
- MYSQL_RANDOM_ROOT_PASSWORD

输入命令,当前设置的密码为root

docker run --name mysql -d -it -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:8-oracle

 

 

 

 

 

posted @ 2023-05-25 12:40  .net&new  阅读(1139)  评论(0)    收藏  举报