我是靠谱客的博主 踏实雪糕,最近开发中收集的这篇文章主要介绍sakila 导入mysql_mysql安装sakila数据库,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1、下载种子数据库

下载位置:http://dev.mysql.com/doc/index-other.html

2、安装种子数据库sakila

[root@localhost ~]# unzip sakila-db.zip

注意:如果没有安装unzip需要安装:yum install -y unzip 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 Enter password:

注意:此处会出现问题:ERROR 1214 (HY000) at line 175: The used table type doesn't support FULLTEXT indexes

原因是:里面的数据库的表sakila-schema.sql是InnoDB,需要把所有的都改成MyISAM

比如:

[root@mysql01 sakila-db]# vi  sakila-schema.sql

找到CREATE TABLE film_text (

film_id SMALLINT NOT NULL,

title VARCHAR(255) NOT NULL,

description TEXT,

PRIMARY KEY  (film_id),

FULLTEXT KEY idx_title_description (title,description)

akila-schema.sqlENGINE=MyISAM DEFAULT CHARSET=utf8;

把InnoDB改成MyISAM 即可

[root@localhost sakila-db]# mysql -uroot -p 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)

最后

以上就是踏实雪糕为你收集整理的sakila 导入mysql_mysql安装sakila数据库的全部内容,希望文章能够帮你解决sakila 导入mysql_mysql安装sakila数据库所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部