Integrated mybatis error Access denied for user; error code: errorCode 1045, state 28000

Obviously, the password configuration is correct. The password is correct
; the value of the configuration file is also correct. But it
prompts that there is no permission, and it indicates that the password is wrong or the user has permission.


Students who have this can try to manually enter the account password and do not read it from the configuration file. If it can, prove that the ${username}${password} keyword used to read the data is occupied, causing the account password to be read out to be wrong of
<context:property-placeholder location="te.properties"/>
    <bean id="datasource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="driverClass" value="${Driver}"/>
        <property name="url" value="${url}"/>
        <property name="username" value="${username}"/>
        <property name="password" value="${password}"/>
    </bean>

change into

<context:property-placeholder location="te.properties"/>
    <bean id="datasource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="driverClassName" value="${jdbc.Driver}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
    </bean>

And replace relevant keywords in the configuration file

Guess you like

Origin blog.csdn.net/m0_49194578/article/details/112793727