使用 MySQL Workbench 创建新数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5515745/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Create a new database with MySQL Workbench
提问by Ant
Being new to MySQL, I have installed the latest version of the MySQL Workbench (5.2.33). I would like to know how you can create a database with this application. In the Overview tab of the SQL editor there are few "MySQL Schema" displayed, are these schemas the existing databases?
作为 MySQL 的新手,我安装了最新版本的 MySQL Workbench (5.2.33)。我想知道如何使用此应用程序创建数据库。在 SQL 编辑器的概览选项卡中,显示的“MySQL 架构”很少,这些架构是现有数据库吗?
回答by Zach Rattner
- Launch MySQL Workbench.
- On the left pane of the welcome window, choose a database to connect to under "Open Connection to Start Querying".
- The query window will open. On its left pane, there is a section titled "Object Browser", which shows the list of databases. (Side note: The terms "schema" and "database" are synonymous in this program.)
- Right-click on one of the existing databases and click "Create Schema...". This will launch a wizard that will help you create a database.
- 启动 MySQL 工作台。
- 在欢迎窗口的左窗格中,在“打开连接以开始查询”下选择要连接的数据库。
- 查询窗口将打开。在其左侧窗格中,有一个标题为“对象浏览器”的部分,其中显示了数据库列表。(旁注:术语“模式”和“数据库”在该程序中是同义词。)
- 右键单击现有数据库之一,然后单击“创建架构...”。这将启动一个向导,帮助您创建数据库。
If you'd prefer to do it in SQL, enter this query into the query window:
如果您更喜欢在 SQL 中执行此操作,请在查询窗口中输入此查询:
CREATE SCHEMA Test
Press CTRL + Enter to submit it, and you should see confirmation in the output pane underneath the query window. You'll have to right-click on an existing schema in the Object panel and click "Refresh All" to see it show up, though.
按 CTRL + Enter 提交它,您应该会在查询窗口下方的输出窗格中看到确认信息。不过,您必须右键单击“对象”面板中的现有架构,然后单击“全部刷新”才能看到它显示出来。
回答by SaiyanGirl
Click the database symbol with the plus sign (shown in the below picture). Enter a name and click Apply
.
单击带有加号的数据库符号(如下图所示)。输入名称并单击Apply
。
This worked in MySQL Workbench 6.0
这在 MySQL Workbench 6.0
回答by фымышонок
回答by Rizwan Shamsher Kaim Khani
In MySQL Work bench 6.0 CE.
在 MySQL 工作台 6.0 CE 中。
- You launch MySQL Workbench.
- From Menu Bar click on Database and then select "Connect to Database"
- It by default showing you default settings other wise you choose you host name, user name and password. and click to ok.
- As in above define that you should click write on existing database but if you don't have existing new database then you may choose the option from the icon menu that is provided on below the menu bar. Now keep the name as you want and enjoy ....
- 您启动 MySQL Workbench。
- 从菜单栏中单击数据库,然后选择“连接到数据库”
- 它默认显示默认设置,否则您选择主机名、用户名和密码。然后点击确定。
- 如上所述,您应该单击写入现有数据库,但如果您没有现有的新数据库,则可以从菜单栏下方提供的图标菜单中选择该选项。现在保留您想要的名称并享受......
回答by Zaid Pathan
Those who are new to MySQL & Mac users; Note that, Connection is different than Database.
那些刚接触 MySQL 和 Mac 的用户;请注意,连接不同于数据库。
Steps to create a database.
创建数据库的步骤。
Step 1: Create connection and click to go inside
第一步:创建连接,点击进入
Step 2: Click on database icon
第二步:点击数据库图标
Step 3: Name your database schema
第 3 步:命名您的数据库架构
Step 4: Apply query
第 4 步:应用查询
Step 5: Your DB created, enjoy...
第 5 步:您的数据库已创建,享受...
回答by omid haghighatgoo
you can use this command :
你可以使用这个命令:
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_specification] ...
create_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
回答by Jetwiz
first, you have to create Models. default model is sakila, so you have to create one. if you already created the new one, go to Database > Forward Engineer. then, your model will exist in local instance:80
首先,您必须创建模型。默认模型是 sakila,所以你必须创建一个。如果您已经创建了新的,请转到数据库 > 正向工程师。然后,您的模型将存在于本地实例中:80
Forward engineer is to create database in your choosed host!
正向工程师就是在你选择的主机上创建数据库!