MySQL中安装样本数据库Sakila过程分享
2014-10-31 00:00
585 查看
通常情况下对于一个全新的MySQL服务器,没有任何数据供我们测试和使用。对此,MySQL为我们提供了一些样本数据库,我们可以基于这些数据库作基本的操作以及压力测试等等。本文描述的是安装sakila数据库。该数据库需要安装在MySQL 5.0以上的版本。以下是其描述。
1、下载种子数据库
下载位置:http://dev.mysql.com/doc/index-other.html
2、安装种子数据库sakila
3、验证安装结果
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:
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)
相关文章推荐
- MySQL中安装样本数据库Sakila过程分享
- MySQL中安装样本数据库Sakila过程
- linux 架设J2EE网站过程分享之一 ―― MYSQL安装
- RHEL6.2编译安装MySQL 5.6.16过程分享
- CentOS 5.5下安装MySQL 5.5全过程分享
- Qt5.2.0 MinGW480 release静态版编译结果、过程及QtCreator配置分享(realfan的编译方法)(configure -h可以显示帮助)(静态编译mysql插件,需要做一些其它工作,机器上要有mysql)(不编译qtwebkit,就不用安装ActivePerl了)(用到 QMediaPlayer的编译办法)
- CentOS 5.5下安装MySQL 5.5全过程分享
- 分享CentOS下MySQL最新版本5.6.13源码安装过程
- 安装linux学习三(2):CentOS 5.5下安装MySQL 5.5全过程分享
- 分享CentOS下MySQL最新版本5.6.13源码安装过程
- CentOS 5.5下安装MySQL 5.5全过程分享
- MySQL基准测试套件Benchmark安装DBI组件过程分享
- mysql 安装sakila样本数据库
- CentOS 5.5下安装MySQL 5.5全过程分享
- MySQL基准测试套件Benchmark安装DBI组件过程分享
- SUSE Linux下源码编译方式安装MySQL 5.6过程分享
- Mac上安装MySQL过程分享
- 64位CentOs7源码安装mysql-5.6.35过程分享
- CentOS 5.5下安装MySQL 5.5全过程分享
- Linux环境下MySQL-python安装过程分享