Introduction to Navicat

1. Installation

After downloading, unzip it and use it directly. Take a look at the unzipped directory:
Double-click to open the following file (you can add a desktop shortcut or add it to the taskbar):

Insert picture description here
Then you will be prompted to enter the registration code:
Insert picture description here
Back In the unzipped folder of Navicat, there is a file called key.txt, open it, there is a registration code in it,
Insert picture description here
Insert picture description here
click OK to open it: the following interface will be displayed
Insert picture description here

2. Simple to use

Since it is a mysql client, we need to connect to the mysql server and
Insert picture description here
enter the ip address and port of the mysql server in the pop-up interface, as well as the mysql user name and password.
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
About the proofreading rules, you can understand by reading these two blogs:
MySQL verification rules
Mysql Summary of the difference between the collation utf8_unicode_ci and utf8_general_ci in

In the above steps, click OK to create a database,
Insert picture description here
and then we will create a new table in the above database.
Insert picture description here

Insert picture description here
Insert picture description here
That is, we use the mouse to
click and click , which is to generate the corresponding SQL statement to execute and then click to save:
Insert picture description here
 This table is generated: If you
 Insert picture description here
don’t believe it, let’s go to the command line and take a look: After this table exists
Insert picture description here
, we will directly You can use this tool to operate the database, because the command line operation is still quite disgusting.
Then we look at the establishment of foreign keys
Insert picture description here
 and then automatically generate the corresponding SQL statement
 Insert picture description here
Insert picture description here
Insert picture description here
and click Save, give a table name, there is this table
Insert picture description here
and then double-click The above table name can insert data.
Insert picture description here
For example, the id field of the dep table above is not set to auto-increment. I want to change it and let the id field become auto-increment. How to
design the table:
Insert picture description here
Insert picture description here
Then what should we do? , Directly delete this table and re-create it?
Your other associated table will definitely not allow you to do this, so you need to cancel the foreign key relationship of the associated table first, or delete the foreign key associated table first,

Insert picture description here
then


delete the foreign key of the associated table , save and then go We want to add auto-increment to the id field in the dep table, set the id field to auto-increment, save it, and then re-add the foreign key of the emp table to the id field of dep . Finally, insert a few pieces of data into the dep table.
Insert picture description here
Insert picture description here
This tool can also The relationship between your tables is shown to you in the form of graphics:
Insert picture description here
Insert picture description here
click on this ER diagram, the relationship between the two will be displayed, then in the future when your tables are many, you can view your own tables through this diagram The relationship between the table and the table, see the effect:
Insert picture description here
if we click on the line between the two tables, we can see the relationship between the two:
Insert picture description here
you can also select the above model to directly create the chart and create the relationship between the tables
Insert picture description here

Insert picture description here
But the model we built above cannot be created directly into the database. It needs to be imported in the form of sql, and then the exported sql statement is executed in the database
Insert picture description here
and then exported and saved to a place to
Insert picture description here
open the exported file. Take a look at the contents inside
Insert picture description here
. It is the SQL statement translated into the model we created. Copy these SQL statements, but execute them in mysql, and wait until the two tables in our model. Is it very convenient?

Navicat tool can also write native sql statements to perform database operations, and
Insert picture description here
you will see an interface for entering sql statements:
Insert picture description here
then write a sql statement to try:
Insert picture description here
Insert picture description here
then run it:
Insert picture description here
we can also use the data exported from the previous database to sql The form of the file is imported into the database through Navicat:
If we have a file imported from the database, the file name is init.sql, and the contents are as follows.

First, we create a new database:
Insert picture description here
Then select the database, click the right button, Choose to run the sql file;
Insert picture description here
Insert picture description here
Insert picture description here
pay attention to the above step, just close it directly, don't click start again
Insert picture description here
and then take a look through the ER diagram, the relationship between each table can be seen very clearly.
We can also comment on the sql statement: select the statement and then ctrl+/ to comment on multiple lines, ctrl+shift+/ to uncomment
ok, Navicat simply introduces it, everyone can practice it~~~

Guess you like

Origin blog.csdn.net/ZYS10000/article/details/108210725