Simple use of MySQL database (Navicat)

Table of contents

1. Preparation work

2. Create a new database

3. Create a new database table

4. Import database tables

5. Write sql statements


1. Preparation work

Step 1: Start the MySQL service

Search for Task Manager in the search bar in the lower left corner of the computer desktop -> open ;

After entering, select the last service ; find the MySQL service name from inside, right-click on the service name  ->  Start (S) to start.

Step 2: Open the downloaded connection tool Navicat

Select the database to connect to ( MySQL... ):

The MySQL - New Connection window pops up :

After completing the above steps, click Test Connection :

The connection is successful  and it’s done! ! !

2. Create a new database

On the established mysql connection- right click-New Database... :

The new database window pops up :

1. Get the database name:; 2. The character set is: utf8 ; 3. The sorting rule is: utf8_icelandic_ci ;

Then click OK  to create successfully! ! !

3. Create a new database table

Open your newly created database, click on  the table  , right-click ->  New Table :

 Add fields here:

 Set the identity column here (check  auto-increment ):

 

 4. Import database tables

 Prepare a table to be imported into the MySQL database:

1. Select the database into which you want to import the table, click on  the table , right-click ->  Run SQL file... :

2.  The Run SQL File  window pops up. In File: select the location of the database table to be imported:

3. Find and click the table you want to import:

4. Click Start to complete the import, and then  close ;

5. Then click on the table  under the database  , right-click  and refresh to complete the import of the table ( note: be sure to refresh~ ).

5. Write sql statements

Click New Query :

Then select the database and table to connect to , and you can start coding to your heart’s content! ! !

Bye~

over. 

Guess you like

Origin blog.csdn.net/weixin_62332711/article/details/124038245