This directory contains files that can be used to set up the menagerie
database that is used in the tutorial chapter of the MySQL Reference
Manual.
These instructions assume that your current working directory is
the directory that contains the files created by unpacking the
menagerie.zip or menagerie.tar.gz distribution. Any MySQL programs
that you use (such as mysql or mysqlimport) should be invoked from
that directory.
To invoke mysql or mysqlimport, either specify the full path name
to the program, or set your PATH environment variable to the bin
directory that contains the programs so that you can invoke them
from anywhere without specifying their full path name. (See your
operating system's help instructions for environment variables.)
The full path name to the programs depends on where MySQL is installed.
For the mysql and mysqlimport commands, supply any connection parameters
necessary (host, user, password) on the command line before the database
name. For more information, see:
http://dev.mysql.com/doc/mysql/en/invoking-programs.html
First, you must create the menagerie database. Invoke the mysql program,
and then issue this statement:
mysql> CREATE DATABASE menagerie;
If you use a database name different from menagerie in the CREATE
DATABASE statement, use that same name wherever you see menagerie
in the following instructions.
Select the menagerie database as the default database:
mysql> USE menagerie;
//方法1:将menagerie中所有文件拷贝到mysql/bin文件夹中
Create the pet table:
mysql> SOURCE cr_pet_tbl.sql
Load the pet table:
mysql> LOAD DATA LOCAL INFILE 'pet.txt' INTO TABLE pet;
To add Puffball's record, use this command:
mysql> SOURCE ins_puff_rec.sql
Create the event table:
mysql> SOURCE cr_event_tbl.sql
Load the event table:
mysql> LOAD DATA LOCAL INFILE 'event.txt' INTO TABLE event;
//方法2:将menagerie文件夹中所有文件拷贝到data文件夹中
Create the pet table:
mysql> SOURCE cr_pet_tbl.sql
Load the pet table:
mysql> LOAD DATA LOCAL INFILE 'pet.txt' INTO TABLE pet;
To add Puffball's record, use this command:
mysql> SOURCE ../data/menagerie/ins_puff_rec.sql
Create the event table:
mysql> SOURCE ../data/menagerie/cr_event_tbl.sql
Load the event table:
mysql> LOAD DATA LOCAL INFILE '../data/menagerie/event.txt' INTO TABLE event;
Alternate procedure:
If you want to create and load the tables from your command interpreter
(cmd.exe or command.com in Windows, or your shell in Unix), use the
following commands after using CREATE DATABASE as shown earlier to
create the menagerie database. In these instructions, "shell>"
represents your command interpreter prompt.
Create the pet table:
shell> mysql menagerie < cr_pet_tbl.sql
To load the pet table, use either of these commands:
shell> mysql menagerie < load_pet_tbl.sql
shell> mysqlimport --local menagerie pet.txt
To add Puffball's record, use this command:
shell> mysql menagerie < ins_puff_rec.sql
Create the event table:
shell> mysql menagerie < cr_event_tbl.sql
Load the event table:
shell> mysqlimport --local menagerie event.txt
没有合适的资源?快使用搜索试试~ 我知道了~
mysql手册教程中的menagerie.zip
共8个文件
sql:4个
txt:3个
doc:1个
5星 · 超过95%的资源 需积分: 9 26 下载量 54 浏览量
2012-12-05
17:59:15
上传
评论
收藏 57KB RAR 举报
温馨提示
mysql参考手册中的教程文档,需要这个db,官网上好像没有了。现在提供给大家使用
资源推荐
资源详情
资源评论
收起资源包目录
menagerie-db.rar (8个子文件)
menagerie-db
cr_pet_tbl.sql 221B
load_pet_tbl.sql 112B
readme.doc 80KB
pet.txt 272B
ins_puff_rec.sql 77B
event.txt 421B
cr_event_tbl.sql 189B
README.txt 3KB
共 8 条
- 1
资源评论
- fcdvdfv2013-09-11还不错,可以用
- liubin_4082013-07-08不错的例子,很容易懂
- LHB2K2014-11-07非常适合初学者的实用性的书,谢谢
今早喝麦片
- 粉丝: 0
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功