spring boot 使用mybatis连接华为云MySQL数据库
spring boot使用mybatis连接MySQL:
applicationg.yml设置:
spring:
datasource: url: jdbc:mysql://***.*.***.***:3306/socks?useSSL=false username: root password: ******* driver-class-name: com.mysql.cj.jdbc.Drivermybatis: configuration: map-underscore-to-camel-case: true #开启驼峰映射启动类中添加@MapperScan(),解决启动时找不到bean的问题
@MapperScan("com.***.***.mapper")华为云绑定公网IP后连接超时的问题:在华为云安全组-添加入向规则,增加3306端口,允许所有IP访问连接后提示无权限访问:Access denied for user ‘root‘@‘***.***.***.***‘ (using password: YES)在Mysql数据库中执行以下语句放开root用户的外网访问权限
grant all privileges on *.* to ‘%‘ identified by ‘******‘ //***表示数据库连接密码
相关推荐
Ezenwang 2020-11-11
云科技时代 2020-11-03
跳舞的芒果 2020-11-03
WangShen 2020-10-28
tutubuchicao 2020-10-28
胡国报 2020-02-17
星月情缘 2020-11-13
sgafdsg 2020-11-04
Michael 2020-11-03
PokiFighting 2020-10-29
qiuyant 2020-10-28
88246630 2020-09-21
Liucute 2020-09-21
guangcheng 2020-09-14
刘炳昭 2020-09-10
mingxiu0 2020-09-02
Geeny 2020-08-26
clong 2020-08-23
egbert 2020-08-10