MySQL中安装样本数据库Sakila过程分享_MySQL
1、下载种子数据库
下载位置:http://dev.mysql.com/doc/index-other.html
2、安装种子数据库sakila
代码如下:
[root@localhost ~]# unzip sakila-db.zip
Archive: sakila-db.zip
creating: sakila-db/
inflating: sakila-db/sakila-schema.sql
inflating: sakila-db/sakila.mwb
inflating: sakila-db/sakila-data.sql
The sakila-schema.sql file contains all the CREATE statements required to create the structure of the Sakila database including tables, views, stored procedures, and triggers.
The sakila-data.sql file contains the INSERT statements required to populate the structure created by the sakila-schema.sql file, along with definitions for triggers that must be created after the initial data load.
The sakila.mwb file is a MySQL Workbench data model that you can open within MySQL Workbench to examine the database structure. For more information, see MySQL Workbench.
[root@localhost ~]# ls
anaconda-ks.cfg Desktop install.log install.log.syslog sakila-db sakila-db.zip
[root@localhost ~]# cd sakila-db
[root@localhost sakila-db]# ls
sakila-data.sql sakila.mwb sakila-schema.sql
[root@localhost sakila-db]# mysql -uroot -p
[root@localhost sakila-db]# mysql -uroot -p
3、验证安装结果
代码如下:
[root@localhost sakila-db]# mysql
root@localhost[(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| scottdb |
| tempdb |
| test |
+--------------------+
7 rows in set (0.01 sec)
root@localhost[(none)]> use sakila
Database changed
root@localhost[sakila]> show tables;
+----------------------------+
| Tables_in_sakila |
+----------------------------+
| actor |
| actor_info |
| address |
| category |
| city |
| country |
| customer |
| customer_list |
| film |
| film_actor |
| film_category |
| film_list |
| film_text |
| inventory |
| language |
| nicer_but_slower_film_list |
| payment |
| rental |
| sales_by_film_category |
| sales_by_store |
| staff |
| staff_list |
| store |
+----------------------------+
23 rows in set (0.00 sec)
root@localhost[sakila]> select count(*) from customer;
+----------+
| count(*) |
+----------+
| 599 |
+----------+
1 row in set (0.01 sec)
下一篇: ORA-12519数据库连接间接性中断
推荐阅读
-
64位CentOs7源码安装mysql-5.6.35过程分享
-
一、mysql数据库,忘记密码怎么处理及处理过程中遇见的问题
-
centos7 中安装 mysql5.6 的过程
-
Win10安装mysql8.0.15 winx64及连接服务器过程中遇到的问题
-
MySQL5.7.24版本的数据库安装过程图文详解
-
Linux环境下MySQL-python安装过程分享
-
centos中mysql备份数据库脚本分享
-
Linux操作系统中源码安装MySQL数据库
-
eclipse Java web项目数据库由oracle更改为mysql中遇到的问题(使用JPA注解)附上修改过程
-
mysql整个数据库迁移至hive:sqoop安装到配置、脚本使用全过程