MySQL Workbench-模式与数据库是否相同? [英] MySQL Workbench - Is Schema the same thing that Database?

查看:187
本文介绍了MySQL Workbench-模式与数据库是否相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为php代码设置数据库名称.

I'm trying to set the Database name for a php code.

但是我有一个疑问,因为在Workbench中,我有一个称为 ** 的MySQL模式.它等于数据库还是不同的东西?我之所以这么问,是因为我没有找到对在Workbench中创建数据库的任何明确引用.

But I have a doubt, because in Workbench I have a MySQL schema called **. Is it equivalent to a Database or is a diferent thing? I'm asking that because I haven't found any explicit reference to DB creating in Workbench.

推荐答案

是的,在MySQL中,架构和数据库是同义词.这甚至扩展到语法:

Yes, in MySQL, schema and database are synonyms. This even extends to the syntax:

CREATE DATABASE foo;
DROP SCHEMA foo;

CREATE SCHEMA bar;
DROP DATABASE bar;

模式和数据库基本上都是表的命名空间.

Both a schema and a database is basically a namespace for tables.

在SQL的其他一些实现中,术语数据库和架构的用法不同.

In some other implementations of SQL, the terms database and schema are used differently.

这篇关于MySQL Workbench-模式与数据库是否相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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