安装mysql

[root@host1 ~]# docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/mysql 5.7 4d1bf91a2e39 37 hours ago 435 MB
docker.io/postgres 9.6 2e95ec592d5a 2 days ago 250 MB docker run -itd --name mysql5.7 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7 [root@host1 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
74fe49e4c570 mysql:5.7 "docker-entrypoint..." 3 minutes ago Up 3 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysql5.7
[root@host1 ~]#
[root@host1 ~]#
[root@host1 ~]#
[root@host1 ~]# docker exec -it mysql5.7 /bin/bash
root@74fe49e4c570:/# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.29 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>

安装postgres

[root@host1 ~]# docker run --name postgres9.6 -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:9.6
f53027308a44ac1aa6d1247fda115b04eb822d44d17ce905d1c19b0eef2a8b13
[root@host1 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f53027308a44 postgres:9.6 "docker-entrypoint..." 3 seconds ago Up 2 seconds 0.0.0.0:5432->5432/tcp postgres9.6
74fe49e4c570 mysql:5.7 "docker-entrypoint..." About an hour ago Up About an hour 0.0.0.0:3306->3306/tcp, 33060/tcp mysql5.7
[root@host1 ~]# docker exec -it postgres9.6 /bin/bash
root@f53027308a44:/#
root@f53027308a44:/#
root@f53027308a44:/# psql -U postgres
psql (9.6.17)
Type "help" for help. postgres=#
postgres=#

最新文章

  1. switch的使用
  2. Sublime Text永久设置使用4个空格缩进
  3. textbox 和lable换行保存和显示
  4. 执行mount命令时找不到介质或者mount:no medium found的解决办法
  5. 查看mysql一些命令的数据库状态
  6. CCProgressTo 和CCProgressTimer
  7. [UWP小白日记-1]判断APP是否是第一次运行初始化SQLITE数据库
  8. TFS 测试用例导入、导出工具
  9. linux环境下安装lnmp出现php安装失败
  10. MySQL-基本命令
  11. PyQt5开发环境搭建
  12. CentOS7 修改MAC地址
  13. 深入理解 RPC
  14. platform总线,设备,驱动的注册
  15. iOS中textbox文本框清除圆角
  16. 半联结&反联结!
  17. 【ecshop】 完全清除版权信息
  18. hmac 算法模块
  19. python3的下载与安装
  20. mysql 复制表结构 / 从结果中导入数据到新表

热门文章

  1. idea中使用Data Source and Drivers时,如果使用自己自定义的jar包
  2. 利用AJAX JAVA 通过Echarts实现豆瓣电影TOP250的数据可视化
  3. MNIST 数据集
  4. axios 请求中的Form Data 与 Request Payload的区别
  5. python操作oracle完整教程
  6. P & R 8
  7. .net core 框架调用顺序
  8. mybatis - 执行 getById
  9. css与js基础
  10. js中的日期控件My97 DatePicker