1 使用docker cp 命令 复制.sql文件到容器中的目录

  docker cp /root/tables.sql /tmp/

2 进入容器内部,导入sql文件到数据库

  docker exec -it 容器id bash

  mysql -uroot -ppassword

  use database_name;

  source /tmp/tables.sql;

  show tables;

即可

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2021-07-16
  • 2022-02-21
  • 2021-07-23
  • 2022-02-21
  • 2021-10-05
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2021-06-28
  • 2021-12-06
  • 2021-10-13
  • 2022-12-23
  • 2021-12-04
  • 2022-02-05
相关资源
相似解决方案