Import the Ruoyi project database script to the mysql database

Use the DBeaver tool to connect to the local mysql database

In the previous article, I have already introduced how to find an alternative software for a certain software. If you don’t know how to find it, you can read the previous article:

Let me introduce a website that I often use to search for similar alternative software 

As we all know, generally speaking, if you use mysql, most of you can use the navicat series, but this series of software is charged, so we use its alternative software DBeaver here. This is a free software.

DBeaver download address: https://dbeaver.io/

69c33be68ae47fa88187def0aadfc0f9.png

Steps to connect to the local mysql database with tools: (If you have not installed the database, please refer to the previous article: Installing the mysql database on the windows operating system )

1e1d153ff36ba25482509d067ccf1b6b.png

e80efef4f3514b1b16643e765a8641aa.png

After connecting according to the above configuration, click Test Connection, it will automatically help you download the jdbc driver jar package required for mysql connection.

How to solve the error Public Key Retrieval is not allowed when DBeaver connects to mysql?

After the driver package is downloaded, click Test Connection again. If nothing unexpected happens, the following prompt box will appear:

793257d31b767609792742c7e9697bef.png

Don't panic, let's click the driver property of the page and change the allowPublicKeyRetrieval in the screenshot to true.

21ea71d8bb28a0ccc02eb754ec1d7b36.png

Then test the connection again to connect successfully:

5cf0d39411a1afc8d84a7684ae108ae3.png

Create the database of Ruoyi project and execute the sql file of the project

Generally, for open source projects found on the Internet, there will be database script files corresponding to the project in the source code directory. Generally, sql, docs, xxxdb, etc. may be used. You can search for them yourself, or search for *.sql files in the project source code directory try. 

If the sql script file of the project is placed under the sql folder:

bf76417f6123c45120f12cc47556dbeb.png

We can first observe the files in the sql folder to see if there is a script to create a database. No database creation script was found, so here we create a database ourselves:

First create a database named ry-vue in the DBeaver tool:

ab9806e3aed7f4668703d1bee888c701.png

Then select the ry-vue database, open a sql query editor, and copy all the sql script files under D:\RuoYi-Vue\sql to execute:

d9146d1c5847a27fc9d44f0fbc7c78da.png

After the scripts are executed, you will see that many tables have been newly created, and there will also be some initialized data in the tables, such as logged-in users, etc.:

5e2772d871ce06fe310dcb25b31fc4b5.png

At the same time, if I am a test novice, I can also use this database to practice and consolidate the basic usage of sql statements.

So far, we have completed the import of the Ruoyi project database script, the next step is to look at the configuration file of the project, change the relevant configuration in the code, and then try to start the project locally~

Follow me and unlock the following series of articles together.

Guess you like

Origin blog.csdn.net/liboshi123/article/details/128722357