mybatis连接数据库时,报java.sql.SQLException: Access denied for user

mybatis连接数据库时,报java.sql.SQLException: Access denied for user '${name}'@'175.10.131.220' (using password: YES)

mybatis连接数据库时,报java.sql.SQLException: Access denied for user_第1张图片

原因是:mybatis-config.xml配置文件的username与database.properties的不匹配,或者在系统中也有个username属性,这时系统变量覆盖了Properties中的值,这时取得username的值为系统的用户名Administrator,密码为properties中的password去查询数据库,此时用户名名和密码并不匹配就会报错。建议改个名字

mybatis连接数据库时,报java.sql.SQLException: Access denied for user_第2张图片

你可能感兴趣的:(mybatis)