How make connection to MySQL server,create an ERR model,Reverse Engineering

in #utopian-io6 years ago (edited)

What Will I Learn?

You will learn

  • make connection to MySQL server
  • create an ERR model
  • Reverse Engineering

Difficulty

Basic

Description

in this tutorial I will discuss how make connection to MySQL server and create an ERR model and Reserve Engineering.

To use MySQL Workbench we can download it at http://dev.mysql.com/downloads/workbench/ for free.
Run the MySQL Workbench application after you install it and you will see a look like below
The above view already contains some data, of course if you just install MySQL Workbench there is no data in the list of MySQL Workbench.

In order for us to use MySQL Workbench to set up our database, we must make a connection to the MySQL server installed on our computer. The trick is as follows:

  • Click New Connection in the SQL Development column.
  • Enter the name of the connection we will create, for example localhost if you use the local server in this tutorial, but it's up to you what the name is.
  • Enter your MySQL server address and its ports, if you use local computer then leave 127.0.0.1 and port 3306. Port 3306 default port of MySQL, if you install MySQL when you use different ports, adjust.
  • Enter the username and password of your MySQL account
  • If you want your connection to be connected to a specific database, you can fill in the name of the database you want in Default Schema, otherwise you do not need to fill it.
    Here is the result of charging above
    When finished click the Test Connection button. If you write Connection parameters are correct then you have successfully made a connection to your MySQL database. Click OK button to save your connection.

Now you are ready to do your MySQL database management. Go to the next section of this tutorial to try to make an EER diagram to be used as your MySQL database.

Here are the steps to create an EER model in MySQL Workbench:

  • Run MySQL Workbench

  • Click create new EER model in the data modeling column

  • Double click on the default auto-generated database, mydb

  • The property will appear from the mydb database at the bottom

  • Rename the database from mydb into test_db (actually it's up to you, but in this tutorial I use test_db as database name)

  • Click 2 times in add diagram in EER diagrams list, if popup choose yes only

  • You are now the editor of the EER model, on the left there is a toolbar for creating EER models, here I will only describe the tools used in this tutorial

  • Click on the table icon
    in the toolbar, then click anywhere on the canvas diagram

  • Click 2 times in the table you just created, name the table tblUser

  • Click the Columns tab at the bottom, there is already a default column that becomes the primary key, which is idtable1, change the name to id and check box AI (Auto Increment)

  • Click 2 times in column Column Name in blank line under id to create new field, give name username

  • Let the datatype of VARCHAR (45)

  • Check the box NN (Not Null) and UQ (Unique)

  • Create a new field again with the password name and check the NN box

  • The final result of the table that has been made is as below

  • Save the diagram you created by clicking File -> Save Model in the menu.

Reverse Engineering

We start the stage for reverse engineering, do the following:

  • Run MySQL Workbench
  • Click Create EER model from the database in the data modeling field
  • The display will appear to select the database connection, select the localhost connection in the previously created Stored Connection
  • See next point
  • Click the next button again after the process is complete
  • Select the databases that want to in reverse engineer, to now select database of test_db which we have made before, then push next
  • Click the next button again after the process is complete
  • The display will appear as below
  • For now we do not need to fiddle with anything just click the button execute
  • After the process is complete click the next button, then click the Finish button



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it does not follow the Utopian Rules, and is considered as plagiarism. Plagiarism is not allowed on Utopian, and posts that engage in plagiarism will be flagged and hidden forever.
Source
You can contact us on Discord.
[utopian-moderator]

Hey @manishmike10, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

@riski46, No matter approved or not, I upvote and support you.

Coin Marketplace

STEEM 0.19
TRX 0.13
JST 0.029
BTC 58196.53
ETH 3121.03
USDT 1.00
SBD 2.42