1, MySQL (SSM)

Rely on:

  • Add Spring Web
  • Add MyBatis Framework
  • Add the MySQL Driver

Or manually add a dependency to pom.xml:

<! -- Spring Web --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <! -- MyBatis --> <dependency> <groupId>org.mybatis.spring.boot</groupId> < artifactId > mybatis - spring - the boot - starter < / artifactId > < version > 2.2.0 < / version > < / dependency > <! -- MySQL --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency>Copy the code

Configuration file:

Spring.datasource. Url = JDBC :mysql://mysql database address: port/database name? ServerTimezone = GMT % 2 b8 spring. The datasource. The username = username spring. The datasource. Password = passwordCopy the code

2, Redis

Dependencies (added as needed) :

<! -- redis --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <! -- redis session --> <dependency> <groupId>org.springframework.session</groupId> <artifactId>spring-session-data-redis</artifactId> </dependency> <! --> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson-spring-boot-starter</artifactId> The < version > 3.13.0 < / version > < / dependency >Copy the code

Configuration file:

Port = port number of the redis server. Spring.redis. Password = password of the redis serverCopy the code

3, the mongo

Rely on:

<! -- MongoDB --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </dependency>Copy the code

Configuration file:

Spring. The data. The mongo. Host = server IP spring. The data. The mongo. Port = database port spring. The data. The mongo. Database = database Spring. The data. The mongo. Username = username spring. The data. The mongo. Password = passwordCopy the code