MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 2069|回复: 1
打印 上一主题 下一主题

mysql示例数据库world安装

[复制链接]
跳转到指定楼层
1#
发表于 2016-10-30 22:58:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1、数据库脚本下载页面 http://dev.mysql.com/doc/index-other.html ,选择
Example Databases
Title
Download DB
HTML Setup Guide
PDF Setup Guide
employee data (large dataset, includes data and test/verification suite)
world database
world_x database
sakila database
menagerie database




2、脚本上传到mysql服务器后解压
unzip world.sql.zip
产生文件world.sql

3、执行sql world.sql文件
mysql -uroot -pgbase123 -t <world.sql
4、验证数据库产生情况
mysql -uroot -pgbase123
show databases;
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
| world              |
+--------------------+
6 rows in set (0.00 sec)


显示存在 world  
5、打开数据world查看表的创建情况
mysql> show tables;
+-----------------+
| Tables_in_world |
+-----------------+
| city            |
| country         |
| countrylanguage |
+-----------------+
3 rows in set (0.00 sec)

表都存在;
并查看数据行数

mysql> select count(1) from city;
+----------+
| count(1) |
+----------+
|     4079 |
+----------+
1 row in set (0.00 sec)

mysql> select count(1) from country;
+----------+
| count(1) |
+----------+
|      239 |
+----------+
1 row in set (0.00 sec)

mysql> select count(1) from countrylanguage;
+----------+
| count(1) |
+----------+
|      984 |
+----------+
1 row in set (0.00 sec)


world数据库示例成功创建。


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖 顶 踩
2#
 楼主| 发表于 2016-10-30 23:01:57 | 只看该作者
格式还是有点问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-4-26 07:13 , Processed in 0.070641 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表