足球游戏_中国足彩网¥体育资讯$

MySQL中安装样本数据库Sakila过程分享
来源:易贤网 阅读:1750 次 日期:2014-11-28 16:59:52
温馨提示:易贤网小编为您整理了“MySQL中安装样本数据库Sakila过程分享”,方便广大网友查阅!

通常情况下对于一个全新的MySQL服务器,没有任何数据供我们测试和使用。对此,MySQL为我们提供了一些样本数据库,我们可以基于这些数据库作基本的操作以及压力测试等等。本文描述的是安装sakila数据库。该数据库需要安装在MySQL 5.0以上的版本。以下是其描述。

1、下载种子数据库

下载位置:>

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 <sakila-schema.sql

Enter password:

[root@localhost sakila-db]# mysql -uroot -p <sakila-data.sql

Enter password:

3、验证安装结果

代码如下:

[root@localhost sakila-db]# mysql

)]> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| performance_schema |

| sakila |

| scottdb |

| tempdb |

| test |

+--------------------+

7 rows in set (0.01 sec)

)]> use sakila

Database changed

]> 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)

]> select count(*) from customer;

+----------+

| count(*) |

+----------+

| 599 |

+----------+

1 row in set (0.01 sec)

中国足彩网信息请查看IT技术专栏

中国足彩网信息请查看数据库
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 加入群交流 | 手机站点 | 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 足球游戏_中国足彩网¥体育资讯$ 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65317125(9:00—18:00) 获取招聘考试信息及咨询关注公众号:hfpxwx
咨询QQ:526150442(9:00—18:00)版权所有:易贤网
云南网警报警专用图标