mysql创建表,制定自增,utf-8编码

create table person
(id int auto_increment primary key,
 name varchar(100), age int, address varchar(100))
 default charset utf8;
 
 
 mysql依赖
 
 <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
 </dependency>
 
 application.properties
 mysql乱码解决,制定连接子串utf-8
 
spring.datasource.url=jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.username=user
spring.datasource.password=password

相关文章:

  • 2021-11-24
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2022-03-04
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2021-10-17
  • 2021-10-08
  • 2022-12-23
  • 2021-09-01
  • 2021-12-03
相关资源
相似解决方案