1 下载示例数据库压缩包
https://downloads.mysql.com/docs/sakila-db.zip
2 解压只有三个文件
[root@www.cndba.cn software]# unzip sakila-db.zip
[root@www.cndba.cn software]# ls -l sakila*
-rw-r--r-- 1 root root 741613 Mar 28 12:59 sakila-db.zip
sakila-db:
total 3396
-rw-r--r-- 1 root root 3398148 Jul 21 2016 sakila-data.sql
-rw-r--r-- 1 root root 50019 Jul 21 2016 sakila.mwb
-rw-r--r-- 1 root root 23424 Jul 21 2016 sakila-schema.sql
1).sakila-data.sql //sakila库数据
2).sakila-schema.sql //sakila库的表结构sql语句
3).sakila.mwb //sakila的MySQL Workbench数据模型
注意MySQL的版本一定要是5.6及以上,因为有的表建立了Fulltext全文索引,而InnoDB在5.6之后才支持全文索引
查看数据库版本
MariaDB [sakila]> select version();
+---------------------+
| version() |
+---------------------+
| 10.2.13-MariaDB-log |
+---------------------+
3 导入示例数据库
[root@www.cndba.cn software]# mysql -uroot -proot
Welcome to the MariaDB monitor. Commands end with ; or /g.
Your MariaDB connection id is 27
Server version: 10.2.13-MariaDB-log MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
MariaDB [(none)]> source /software/sakila-db/sakila-schema.sql
MariaDB [sakila]> source /software/sakila-db/sakila-data.sql
版权声明:本文为博主原创文章,未经博主允许不得转载。