docker pull mysql/mysql-server:latest docker run --name=mysqld -d mysql/mysql-server:latest docker logs mysqld 2>&1 | grep -i GENERATED [Entrypoint] A random onetime password will be generated. [Entrypoint] GENERATED ROOT PASSWORD: zippYgGabj3lIdycyGobQifdar, docker exec -it 1d131fc33981 mysql -uroot -pzippYgGabj3lIdycyGobQifdar, mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'redhat'; mysql> FLUSH PRIVILEGES ; mysql> exit docker cp cinder.sql 1d131fc33981:/ docker exec -it 1d131fc33981 mysql -uroot -predhat mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 22 Server version: 8.0.21 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> create database cinder ; mysql> use cinder ; mysql> source /cinder.sql mysql> show tables ; +----------------------------+ | Tables_in_cinder | +----------------------------+ | attachment_specs | | backup_metadata | | backups | | cgsnapshots | | clusters | | consistencygroups | | driver_initiator_data | | encryption | | group_snapshots | | group_type_projects | | group_type_specs | | group_types | | group_volume_type_mapping | | groups | | image_volume_cache_entries | | messages | | migrate_version | | quality_of_service_specs | | quota_classes | | quota_usages | | quotas | | reservations | | services | | snapshot_metadata | | snapshots | | transfers | | volume_admin_metadata | | volume_attachment | | volume_glance_metadata | | volume_metadata | | volume_type_extra_specs | | volume_type_projects | | volume_types | | volumes | | workers | +----------------------------+ 35 rows in set (0.00 sec)