• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase
您的位置:首页 > 数据库 >Mysql > MySQL中安装样本数据库Sakila过程分享

MySQL中安装样本数据库Sakila过程分享

作者:Leshami 字体:[增加 减小] 来源:互联网 时间:2017-05-11

Leshami通过本文主要向大家介绍了mysql sakila,sakila数据库,sakila,sakila db.zip,mysql数据库等相关知识,希望本文的分享对您有所帮助

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

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 <sakila-schema.sql
Enter password:
[root@localhost sakila-db]# mysql -uroot -p <sakila-data.sql
Enter password:
</div>

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)
</div>

</div>
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • MySQL中安装样本数据库Sakila过程分享

相关文章

  • 2018-12-05MySQL数据库管理常用命令小结
  • 2018-12-05关于mysql互换表中两列数据方法的讲解
  • 2017-05-11mysql基础:mysqld_safe 启动执行流程详解
  • 2018-12-05布尔教育燕十八Memcached视频资料分享
  • 2018-12-05mysql 读写分离(实战篇)
  • 2018-12-05Mysql 报Row size too large 65535 的原因及解决方法_MySQL
  • 2018-12-05MySQL 5.6 如何更改安全的处理密码探讨
  • 2018-12-05Mysql5.7.19在Linux下卸载的方法介绍
  • 2018-12-05ubuntu下关于mysql 5.6版本的删除/安装/编码配置文件配置的详解
  • 2018-12-05如何利用docker快速构建MySQL主从复制环境的详情介绍

文章分类

  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase

最近更新的内容

    • mysqlhotcopy 正则使用小技巧
    • mysql学习之基础知识详解
    • 关于MySQL数据库 增删改查语句集锦
    • 写给毕业生
    • Ubuntu与windows双系统下共用MySQL数据库的方法
    • Mysql中Insert into xxx on duplicate key update问题
    • oracle 多个字符替换实现
    • 基于SQL中SET与SELECT赋值的区别详解
    • mysql日志滚动
    • MySQL用户权限管理实例详解

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有