连接数据库

Client does not support authentication protocol requested by server; consider upgrading MySQL client

最新的mysql模块并未完全支持MySQL 8的“caching_sha2_password”加密方式,而“caching_sha2_password”在MySQL 8中是默认的加密方式。因此,下面的方式命令是默认已经使用了“caching_sha2_password”加密方式,该账号、密码无法在mysql模块中使用。

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
       <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
       <property name="url" value="jdbc:mysql://127.0.0.1:3306/vodb?useUnicode=true&amp;characterEncoding=utf-8"/>
       <property name="username" value="root"/>
       <property name="password" value="123456"/>
    </bean>
原文地址:https://www.cnblogs.com/perfei/p/13070747.html