1.Use the following commands to import the sakila database to your Mysql instance
Solution:
# wget https://downloads.mysql.com/docs/sakila-db.tar.gz
# tar -xvf sakila-db.tar.gz
# mysql -uroot -pmsandbox < sakila-db/sakila-schema.sql
# mysql -uroot -pmsandbox < sakila-db/sakila-data.sql


2.The following commands will import the world database to your MySQL instance
Solution:
# wget https://downloads.mysql.com/docs/world-db.tar.gz
# tar -xvf world-db.tar.gz
# mysql -uroot -plearning_mysql < world-db/world.sql


3.The following commands will import the test_db database to your MySQL instance
Solution:
# git clone https://github.com/datacharmer/test_db.git
# cd test_db
# cat employees.sql | mysql -uroot -psekret



测试结果:


本教程提供了将 Sakila、World 和 test_db 数据库导入 MySQL 实例的步骤。首先,使用 wget 下载数据库文件,然后使用 tar 解压缩,最后通过 mysql 命令行工具将 schema 和数据导入到相应的 MySQL 用户和数据库中。
788

被折叠的 条评论
为什么被折叠?



