使用MySQL Workbench创建一个新数据库 [英] Create a new database with MySQL Workbench
问题描述
作为MySQL的新手,我安装了最新版本的MySQL Workbench(5.2.33)。我想知道如何使用此应用程序创建数据库。在SQL编辑器的概述选项卡中,显示了几个MySQL模式,这些模式是否存在数据库?
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 Workbench。
- 在欢迎窗口的左窗格中,在打开连接以开始查询下选择要连接到的数据库。
- 将打开查询窗口。在其左窗格上,有一个标题为对象浏览器的部分,其中显示了数据库列表。 (旁注:程序中的术语schema和database在此程序中是同义词。)
- 右键单击其中一个现有数据库,然后单击Create Schema ...。这将启动一个向导,将帮助您创建一个数据库。
- 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.
如果您希望在SQL中执行此操作,请在查询窗口中输入此查询:
If you'd prefer to do it in SQL, enter this query into the query window:
CREATE SCHEMA Test
按CTRL + Enter提交它,您应该在查询窗口下方的输出窗格中看到确认。您必须右键单击对象面板中的现有架构,然后单击全部刷新以查看它是否显示。
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.
这篇关于使用MySQL Workbench创建一个新数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!