MySQL '创建模式'和'创建数据库'- 有什么区别吗 [英] MySQL 'create schema' and 'create database' - Is there any difference

查看:94
本文介绍了MySQL '创建模式'和'创建数据库'- 有什么区别吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

information_schema 数据库中达到峰值并在我的一个宠物项目的元数据 中达到峰值,我很难理解有什么(如果有的话)差异MySQL 的 create schema 命令和 create database 命令之间存在.

Taking a peak into the information_schema database and peaking at the metadata for one of my pet projects, I'm having a hard time understanding what (if any) differences there are between the create schema command and the create database command for MySQL.

有什么不同吗?如果不是,这是否是关系数据库的一种相当典型的行为模式(我听说对于其他数据库,例如 Oracle,数据库中存在模式,而不是与数据库处于同一级别).

Are there any differences? If not, is this a rather typical pattern of behavior for relational databases (I've heard that for other databases, such as Oracle, a schema exists in a database, rather than being on the same level as a database).

谢谢!

推荐答案

MySQL 文档说:

CREATE DATABASE 创建一个数据库用给定的名字.要使用这个声明,你需要 CREATE数据库的特权.创造SCHEMA 是 CREATE 的同义词从 MySQL 5.0.2 开始的数据库.

CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2.

因此,这两条指令执行相同的操作似乎很正常.

So, it would seem normal that those two instruction do the same.

这篇关于MySQL '创建模式'和'创建数据库'- 有什么区别吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆