安装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. windows系统 安装 mysql.fx

    windows系统 安装 mqtt.fx 软件官网:http://mqttfx.jfx4ee.org/ 软件下载:http://www.jensd.de/apps/mqttfx/1.1.0/

  2. EAC3 channel & program extension

    EAC3 bit stream syntax允许在single bitstream中存在time-multiplexed substreams. 在EAC3的signle bitstream中,允许s ...

  3. Perl unless

    在perl的if控制结构中,只有当条件表达式为真时才执行某块代码.如果想让程序块在条件为假时才执行,此时可以把if改成unless 例如: unless ($fred =~ /^([A-Z_]\w*$ ...

  4. 微信小程序 购物车流程

    购物车流程 一.需求分析 a:全选,单选,根据选中的计算数目和总价 b:单个商品加减 c:删除一个商品 wxml 布局 <view> <view v-if="flag&qu ...

  5. python专题知识追寻者对OS的理解

    一 前言 OS(operating system)直接对操作系统进行操作的接口,功能真是非常强大:允许知识追寻者简要概括一下整体模块 如果要对文件进行读写可以使用os.open()方法 如果要对文件路 ...

  6. 【网易官方】极客战记(codecombat)攻略-地牢-祸之火焰

    关卡连接: https://codecombat.163.com/play/level/banefire 绕着火焰跳舞,否则你的骨头下次就会被烧着 默认代码 # 食人魔看上去又大又慢,这是你的机会. ...

  7. 使用webpack搭建vue环境

    1.安装node.js,在官网下载,直接下一步,完成.nodejs里默认包含npm环境.国内安装包的速度太慢,建议使用cnpm淘宝镜像. npm install -g cnpm --registry= ...

  8. appium---如何判断原生页面和H5页面

    目前app中存在越来越多的H5页面了,对于一些做app自动化的测试来说,要求也越来越高,自动化不仅仅要支持原生页面,也要可以H5中进行操作自动化,这一篇介绍如何查看页面上是否存在H5页面,这里首先要了 ...

  9. centos6.5下安装mysql数据库

    centos6.5下安装mysql数据库 1.安装mysql数据库:yum install mysql-server 2.临时启动数据库:service mysqld start 3.开机启动数据库: ...

  10. cnblogs在手机端显示的一些坑

    目前在网上搜了个博皮,很高大上,感兴趣的朋友可以看一下,但是在手机端显示这些html5代码有很多缺陷: 1. h1.h2只能显示一行,如果字数太多,则会被隐藏 就像你现在看到的,h1原本内容为: 目前 ...