Which Option Should I Select When Installing Mysql if I Want to Upload and Query the Tables

nine.3.i Creating a Model

This tutorial describes how to create a new database model and how to forrard-engineer a model to a live MySQL server.

  1. Start MySQL Workbench. On the home screen, click the models view from the sidebar and so click (+) next to Models. Alternatively, you tin can click and and then from the card (shown in the figure that follows).

    Figure nine.22 Getting Started Tutorial - Home Screen

    Content is described in the surrounding text.

    A model can comprise multiple schemas. Note that when yous create a new model, it contains the mydb schema by default. You lot tin change the name of this default schema every bit needed or yous tin can delete it.

  2. Click the + button on the right side of the Physical Schemas toolbar to add a new schema. The default schema proper name is new_schema1, which you lot can at present change to dvd_collection by modifying its Name field. Confirm this change in the Physical Schemas console shown in the next figure. At present you are fix to add together a table.

    Figure 9.23 Getting Started Tutorial - New Schema

    Content is described in the surrounding text.


  3. Double-click Add together Table in the Physical Schemas section.

  4. This automatically loads the table editor with the default tabular array proper noun table1. Edit the Tabular array Name field to change the tabular array name from table1 to movies .

  5. Next, add columns to your table. Double-click a Column Name prison cell and the first field defaults to moviesid considering (past default) MySQL Workbench appends id to the tabular array name for the initial field. Alter moviesid to movie_id and keep the Datatype as INT, and also select the PK (PRIMARY Fundamental), NN (Not NULL), and AI (AUTO_INCREMENT) cheque boxes.

  6. Add the two additional columns described in the following tabular array. The figure that appears after the table shows all 3 columns in the movies table.

    Column Proper noun Data Blazon Column Backdrop
    movie_title VARCHAR(45) NN
    release_date Engagement (YYYY-MM-DD) None

    Figure 9.24 Getting Started Tutorial - Editing table columns

    Content is described in the surrounding text.


  7. For a visual representation (EER diagram) of this schema, select and so to create the EER Diagram for the model. The adjacent figure shows the a new tab titled EER Diagram, which displays diagram representation of the movies table and columns.

    Figure ix.25 Getting Started Tutorial - EER Diagram

    Content is described in the surrounding text.


  8. In the table editor, alter the name of the column movie_title to title . Note that the EER Diagram is automatically updated to reflect this change.

    Annotation

    To open the tabular array editor, either change dorsum to the MySQL Model tab and correct-click on the movies table, or right-click on movies in the EER diagram and select an option.

  9. Save the model by choosing and then from the carte du jour, or click the Save Model to Current File icon on the carte toolbar. For this tutorial, type Home_Media and then click Save.

Earlier synchronizing your new model with the live MySQL server, ostend that y'all already created a MySQL connection. This tutorial assumes you accept created a connexion already. If not, come across Section 5.ii, "Creating A New MySQL Connectedness (Tutorial)" and utilise that tutorial to create a MySQL connectedness named MyFirstConnection, although an alternative connection tin besides work.

Now frontwards-engineer your model to the live MySQL server as follows:

  1. Select then from the menu to open up the Forwards Engineer to Database magician.

  2. The Connection Options pace selects the MySQL connectedness and optionally sets additional options for the selected MySQL connection. Make any necessary connection changes and then click Next.

    Note

    You may decided to choose a different MySQL connection here, merely this tutorial uses MyFirstConnection.

  3. The Options footstep lists optional avant-garde options (equally shown in the figure that follows). For this tutorial, you can ignore these options and click Next.

    Figure 9.26 Getting Started Tutorial - Options

    Content is described in the surrounding text.


  4. Select an object to export to the live MySQL server. In this case, there is only ane tabular array (dvd_collection.movie). Select the Consign MySQL Table Objects check box (as the effigy that shows) and then click Adjacent.

    Figure 9.27 Getting Started Tutorial - Select Objects

    Content is described in the surrounding text.


  5. The Review SQL Script step displays the SQL script that will be executed on the live server to create your schema. Review the script to brand certain that y'all understand the operations that will exist carried out.

    Click Side by side to execute the forward-engineering science procedure.

    Figure 9.28 Getting Started Tutorial - Review SQL Script

    Content is described in the surrounding text.


  6. The Commit Progress step confirms that each task was executed. Click Show Logs to view the logs. If no errors are present, click Shut to close the wizard.

  7. The new dvd_collection database is now present on the MySQL server. Confirm this by opening the MySQL connectedness and viewing the schema list, or by executing Prove DATABASES from the MySQL Command Line Client ( mysql ).

  8. Click the Save Model to Current File icon on the menu toolbar to salve the model.

For additional information virtually information modeling, see Chapter ix, Database Design and Modeling.


foxhadel1973.blogspot.com

Source: https://dev.mysql.com/doc/workbench/en/wb-getting-started-tutorial-creating-a-model.html

0 Response to "Which Option Should I Select When Installing Mysql if I Want to Upload and Query the Tables"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel