[Chen Xi to work hard] : hello, I am Chen Xi, very glad you can read, nickname is to hope that they can continue to improve, toward excellent programmers! The blog comes from the summary of the problems encountered in the project and programming, and occasionally THERE will be reading and sharing. I will update the Summary of relevant knowledge points such as Java front end, background, database and project case successively. Thank you for your reading and attention. We quarrymen, with the heart of the cathedral, may we go to our respective loves…
📖 how to run SpringBoot project, click the picture can be enlarged to see carefully
☕️Java compilation tool and environment:
IDEA JDK18. MySQL8. 0 Maven
Copy the code
Step 1: Configure Maven
Step 1: Open the project with IDEA and prepare to configure the Maven environment. Of course, if maven is not configured locally, use the default configuration of IDEA
Steps for Configuring Maven
🎩 case 1: If maven is not configured locally, keep the default Settings as follows (if maven is not configured, ignore case 2).
🎩 Case 2: If the Maven repository address has been configured locally, change it to your local Maven address in the red box above
If I have configured the Maven repository
The Maven repository has been configured locally at 🌊: Three reference configuration cases, one is a directory, one is an XML file, one is the jar package address
📝 Because I have the Maven environment locally, the configuration changes here are suitable for me locally
Step 2: Configure the JDK environment
🎩 If your code goes viral, check to see if the Java runtime environment is configured
Find where to configure the JDK and configure the JDK environment on your computer
Check some related directories and change them to something related to JDK1.8 For the above configuration, click Apply and then OK. After executing, click the refresh button on the right side of the picture several times
☕️ if the red, click the refresh symbol many times, you can also perform precompilation, after the execution of the dependency will be downloaded to the local
🚀 the cause of the explosion: Local dependency package is missing, need to download, click the refresh symbol will download
Step 3: Check the database configuration
📝 [configuration file] SpringBoot project find the ApplicationyML file
☕️ Check whether the database name, database account, and database password are consistent with the local MySQL database and MySQL library
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql: / / 127.0.0.1:3306 /cwgl?characterEncoding=utf-8&serverTimezone=UTC
username: root
password: root
Copy the code
Note: If the login fails, troubleshoot the database connection problem first
Initialize data
MySQL > create database with NavicatThe name must be the same as the name in the configuration file
Copy our SQL file into the new query and click Run
Run the project
🚀 Page Inputhttp://localhost:8080/You can visit
For the login account and password, see Database Initialization DataCopy the code
Add: Configure path access for different projects
📣 thank you very much for reading this article. If this article has been helpful to you, please leave a like 👍 follow ❤️ share 👥 message thanks!!
📚 may we rush to each other’s love!