ERROR 14856 --- [reate-882003853] com.alibaba.druid.pool.DruidDataSource : create connection error...

ERROR 14856 --- [reate-882003853] com.alibaba.druid.pool.DruidDataSource : create connection error, url: jdbc:mysql://localhost:3306/xhb?useUnicode=true&characterEncoding=UTF-8, errorCode 1045, state 28000

java.sql.SQLException: Access denied for user 'root  '@'localhost' (using password: YES)

 errorCode 1045, state 28000

步骤一:

        未开启远程操作权限

  1. win+R->cmd进入登录自己的mysql:
    输入命令:mysql -u root -p ****(输入自己的密码)
  2. 输入远程命令:GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;(输入自己的用户名和密码)
  3. 刷新:flush privileges;

步骤二:

        需要在项目的application.yml配置中加上:&useSSL=false&serverTimezone=UTC

     

 

 步骤三:

按如下操作

ERROR 14856 --- [reate-882003853] com.alibaba.druid.pool.DruidDataSource : create connection error..._第1张图片

运行正常了

ERROR 14856 --- [reate-882003853] com.alibaba.druid.pool.DruidDataSource : create connection error..._第2张图片

 

转载于:https://www.cnblogs.com/Sarah-Strawberry/p/11083160.html

你可能感兴趣的:(ERROR 14856 --- [reate-882003853] com.alibaba.druid.pool.DruidDataSource : create connection error...)