美文网首页
Docker 4:简单shell脚本安装mysql5.7

Docker 4:简单shell脚本安装mysql5.7

作者: _百草_ | 来源:发表于2022-04-12 09:29 被阅读0次

1. 安装mysql 5.7

docker run -p 3306:3306 --name containter_mysql -v ~/mysql/conf:/etc/mysql/conf.d -v ~/mysql/data:/var/lib/mysql -v ~/mysql/logs:/logs -e MYSQL_ROOT_PASSWORD=xxx -d mysql:5.7

2. 进入容器中

进入docker容器
docker exec -it [containter] /bin/sh
可以使用容器名或容器id
报错:vi: not found
apt-get update 是同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引。
apt-get upgrade 是升级已安装的所有软件包,升级之后的版本就是本地索引里的。

# vi my.cnf
/bin/sh: 11: vi: not found
# cd /bin
# ls  # 查看bin下所有命令,vi不再其中
bash   dd             false    hostname  more           readlink   su        uncompress    zegrep
cat    df             fgrep    ln        mount          rm         sync      vdir          zfgrep
chgrp  dir            findmnt  login     mountpoint     rmdir      tar       wdctl         zforce
chmod  dmesg          fuser    ls        mv             run-parts  tempfile  which         zgrep
chown  dnsdomainname  grep     lsblk     nisdomainname  sed        touch     ypdomainname  zless
cp     domainname     gunzip   mkdir     pidof          sh         true      zcat          zmore
dash   echo           gzexe    mknod     pwd            sleep      umount    zcmp          znew
date   egrep          gzip     mktemp    rbash          stty       uname     zdiff
# apt-get install --help  # 安装
apt 1.8.2.3 (amd64)
Usage: apt-get [options] command
       apt-get [options] install|remove pkg1 [pkg2 ...]
       apt-get [options] source pkg1 [pkg2 ...]

apt-get is a command line interface for retrieval of packages
and information about them from authenticated sources and
for installation, upgrade and removal of packages together
with their dependencies.

Most used commands:
  update - Retrieve new lists of packages  # 检索最新包
  upgrade - Perform an upgrade
  install - Install new packages (pkg is libc6 not libc6.deb)  # 安装新包
  reinstall - Reinstall packages (pkg is libc6 not libc6.deb)
  remove - Remove packages
  purge - Remove packages and config files
  autoremove - Remove automatically all unused packages
  dist-upgrade - Distribution upgrade, see apt-get(8)
  dselect-upgrade - Follow dselect selections
  build-dep - Configure build-dependencies for source packages
  clean - Erase downloaded archive files
  autoclean - Erase old downloaded archive files
  check - Verify that there are no broken dependencies
  source - Download source archives
  download - Download the binary package into the current directory
  changelog - Download and display the changelog for the given package

See apt-get(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
                                        This APT has Super Cow Powers.
#
linux命令 apt-get update;未找到解决办法
解决办法:换源

https://blog.csdn.net/qq_46514118/article/details/121065750

相关文章

网友评论

      本文标题:Docker 4:简单shell脚本安装mysql5.7

      本文链接:https://www.haomeiwen.com/subject/lhmddrtx.html