Docker introduced into a container file sql

1 Use docker cp command to copy the file to the container .sql directory

  docker cp /root/tables.sql /tmp/

2 into the interior of the container, to import database files sql

  docker exec -it 容器id bash

  mysql -uroot -ppassword

  use database_name;

  source /tmp/tables.sql;

  show tables;

To

Guess you like

Origin www.cnblogs.com/WaterGe/p/11241810.html