IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

Springboot连接MySQL8.0出现的问题

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

以前用的是5.7版本的MySQL,在学习实践Springboot的时候顺带升级了一下8.0,遇到了一些坑,在这记录一下,有碰到同类问题的童鞋需要自取。

使用 navicat连接发现报错1251- Client does not support authentication protocol 错误

这个笔者查询资料发现是新版本的加密规则变了,在mysql8之后,加密规则是caching_sha2_password,之前的是mysql_native_password,所以解决办法要不就是升级navicat要不就是修改加密规则。

这里修改加密规则:

1.进入MySQL的bin目录打开CMD,然后输入mysql -u root -p,输入密码

2.然后输入

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '输入你的密码'; #更新一下用户的密码 

FLUSH PRIVILEGES; #刷新权限

Mysql8.0)Could not create connection to database server – java mysql connector

这是因为没有更新驱动的原因,在Maven中更新下mysql-connector的版本

<!-- MySQL 连接驱动依赖 -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>

<!--properties文件中更改driver-->
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

使用JDBC连接MySql时出现:The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration

这是MyBatis时区错误,在链接库的url中加serverTimezone=UTC

spring.datasource.url=jdbc:mysql://localhost:3306/axin?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

文章永久链接:https://tech.souyunku.com/?p=48606


Warning: A non-numeric value encountered in /data/wangzhan/tech.souyunku.com.wp/wp-content/themes/dux/functions-theme.php on line 1154
赞(86) 打赏



未经允许不得转载:搜云库技术团队 » Springboot连接MySQL8.0出现的问题

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码
IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

评论 抢沙发

大前端WP主题 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

微信扫一扫打赏

微信扫一扫打赏


Fatal error: Uncaught Exception: Cache directory not writable. Comet Cache needs this directory please: `/data/wangzhan/tech.souyunku.com.wp/wp-content/cache/comet-cache/cache/https/tech-souyunku-com/index.q`. Set permissions to `755` or higher; `777` might be needed in some cases. in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php:367 Stack trace: #0 [internal function]: WebSharks\CometCache\Classes\AdvancedCache->outputBufferCallbackHandler() #1 /data/wangzhan/tech.souyunku.com.wp/wp-includes/functions.php(5109): ob_end_flush() #2 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all() #3 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /data/wangzhan/tech.souyunku.com.wp/wp-includes/plugin.php(470): WP_Hook->do_action() #5 /data/wangzhan/tech.souyunku.com.wp/wp-includes/load.php(1097): do_action() #6 [internal function]: shutdown_action_hook() #7 {main} thrown in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php on line 367