Creating a database via MySQL Workbench with a SQL script 

Creating a database using MySQL Workbench with a SQL script is relatively straightforward. Simply go through the following steps: 

  1. Open MySQL Workbench.
  2. Connect to your local instance or a dev/test instance. Don't perform any of these steps on a live production server
  3. Click the new SQL script button, which is highlighted in the following screenshot:

  1. Copy or type the following script into the script window in MySQL Workbench:
CREATE DATABASE yourschema; 
  1. Click the execute script button, highlighted in the following screenshot:

  1. Once the script is done executing, the Output panel will show that it is successful:

You don't need the backticks (`) around yourschema in the preceding script, but MySQL puts them there by default whenever you script an object. We will walk through how to script objects later in this chapter. 
  1. Once you click the refresh button on your SCHEMAS panel, you will see your new database, as shown in the following screenshot:

Now, you will be able to add database objects, such as tables, to your new database. We will do a walkthrough of this in the Creating a table in the database table section later in this chapter. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.253.62