MySQL'创建模式'和'创建数据库' - 有什么区别 [英] MySQL 'create schema' and 'create database' - Is there any difference
问题描述
对于我的一个宠物项目,在 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).
谢谢!
推荐答案
CREATE DATABASE创建具有给定名称的数据库
。要使用此
语句,您需要CREATE
数据库的特权。 CREATE
SCHEMA是MySQL 5.0.2中的CREATE
DATABASE的同义词。
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屋!