安装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=#

docker运行安装mysql postgres的更多相关文章

  1. 在docker中安装mysql

    #!/bin/sh # 安装docker # 在docker中安装mysql # 解决了docker容器中无法输入中文的问题 ##########################安装docker # ...

  2. CentOS双机中Docker下安装Mysql并配置互为主从模式

    CentOS双机中Docker下安装Mysql并配置互为主从模式 目录 1.搜索镜像... 1 2.拉取镜像... 1 3.绑定端口: 1 4.配置文件(修改/etc/mysql/my.cnf文件): ...

  3. 运行安装mysql 报错 [root@localhost mysql-mult]# ./scripts/mysql_install_db  --defaults-file=conf/3306my.cnf FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_

    运行安装mysql 报错 [root@localhost mysql-mult]# ./scripts/mysql_install_db  --defaults-file=conf/3306my.cn ...

  4. docker微服务部署之:四、安装docker、docker中安装mysql和jdk1.8、手动构建镜像、部署项目

    docker微服务部署之:三,搭建Zuul微服务项目 1.Centos7安装Docker 详见:Centos7安装Docker 2.Docker中安装jdk1.8 详见:使用Docker构建jdk1. ...

  5. docker下安装mysql数据库

    因为用了.net core 所以想学习下使用docker: 项目中刚好要用到mysql数据库,所用用docker来安装一次,我使用的是5.6版本: 1.拉取官方镜像 docker pull mysql ...

  6. docker 静默安装mysql

    debconf-set-selections命令 1.功能作用 在debconf database中插入默认值 2.位置 /usr/bin/debconf-set-selections 3.格式用法 ...

  7. Linux上通过docker方式安装mysql

    centos版本信息: docker版本信息 mysql版本:5.7 1.docker方式安装 首先拉取mysql镜像:docker pull mysql:5.7     查看本地的mysql镜像 执 ...

  8. docker:安装mysql多个

    文章来源:https://www.cnblogs.com/hello-tl/p/9238298.html 1.首先安装docker 参照一下网址安装docker docker:安装 https://w ...

  9. php连接docker运行的mysql,显示(HY000/2002): Connection refused的解决办法

    php要连接docker中运行的mysql是不能用localhost, 127.0.0.1来连接的,因为每个docker运行容器的localhost 127.0.0.1都是自己容器本身,不是mysql ...

随机推荐

  1. 关于video++,jsrun,有道笔记等的感想

    这几天一直在思考切入点.想了很多,有关于给初创企业提供社交平台营销的,如公众号,小程序,支付宝的到位,附近等.这些初看起来可行,细想起来有一些根本不完备.如通过微小宝多平台客户端了解最热的内容,在内容 ...

  2. 执行ifconfig eth2 up命令报错eth2: unknown interface: No such device的解决思路

    排查问题思路 一般出现这种状况都是网卡mac地址错误引起的!要么网卡配置文件中的mac地址不对,要么/etc/udev/rules.d/70-persistent-net.rules文件中的mac地址 ...

  3. EntityFramework 根据时间筛选数据

    需求:根据当前时间,获取条件合适的数据,其中截止时间只比较日期. 1. 运行会报错的版本: var lifeWorkEventBatch = clientRepositoryContainer.Lif ...

  4. C#堆和栈的入门理解

    声明:以下内容从网络整理,非原创,适当待入个人理解. 解释1.栈是编译期间就分配好的内存空间,因此你的代码中必须就栈的大小有明确的定义:堆是程序运行期间动态分配的内存空间,你可以根据程序的运行情况确定 ...

  5. sqli-libs(54-65关)

    Less_54 Less-54:使用’’包裹 对输入的次数做了限制,必须在10次请求之内获取信息,否则会刷新表名 输入:?Id=1’ order by 3--+   查看有多少列: 输入 ?id=-1 ...

  6. K8S集群搭建之软路由的安装

    一.系统要求 ①镜像:win10 ②1C.4G.20G即可 ③仅主机模式(共享网卡上网) ④老毛桃PE ⑤ip为192.168.66网段(因为我设置的其他K8S节点也为该网段)---koolshare ...

  7. 设置textarea不可拉伸

    默认情况下,我们将鼠标移动到textarea的右下角时发现文本域是可以通过拖动的方式改变其大小的,这会影响我们原本的页面布局.若想设置其不可拖动,可为其添加如下属性: style="resi ...

  8. 如何利用wx.request进行post请求

    1,method 是  get  方式的时候,会将数据转换成 query string method 为 post 时,header为{"Content-Type": " ...

  9. UTC/GMT/CST/RTC

    GMT:格林尼治标准时间,是指位于伦敦郊区的皇家格林尼治天文台的标准时间,因为本初子午线被定义在通过那里的经线.也就是零时区的时间. UTC:世界协调时间,是一个时间系统.可以理解为这个地球的标准时间 ...

  10. handler method 参数绑定

    handler method 参数绑定常用的注解,我们根据他们处理的Request的不同内容部分分为四类:(主要讲解常用类型) A.处理requet uri 部分(这里指uri template中va ...