下载mysql镜像

[root@localhost ~]# docker pull mysql:5.5.59

 

创建mysql容器

[root@localhost ~]# docker run -itd --name mysql -p 3309:3306 --restart=always -e MYSQL_ROOT_PASSWORD=123456 mysql:5.5.59
-i,-interactive          Keep STDIN open even if not attached
-t,--tty                 Allocate a pseudo-TTY
-d, --detach             Run container in background and print container ID
--name string            Assign a name to the container 
-p,--publish list        Publish a container's port(s) to the host
--restart string         Restart policy to apply when a container exits (default "no")
-e ,--env list           Set environment variables

 

相关文章:

  • 2021-09-07
  • 2022-02-10
  • 2022-01-12
  • 2021-08-12
  • 2021-12-19
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2022-01-07
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-10-02
  • 2021-11-13
相关资源
相似解决方案