mac下配置ssm框架,连接mysql,连接不上Access denied for user 'huang'@'localhost' (using passwo
在windows上配置好的ssm框架,正常使用,拷贝到mac系统下去运行,其他都正常,但是查询数据库中的数据时,连接不上数据库,报如下错,求助
十一月 05, 2019 11:28:53 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [dispatcherServlet] in context with path [/easyUI] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'huang'@'localhost' (using password: YES))
### The error may exist in class path resource [com/huibo/po/userMapper.xml]
### The error may involve com.huibo.dao.UserDao.select
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'huang'@'localhost' (using password: YES))] with root cause
java.sql.SQLException: Access denied for user 'huang'@'localhost' (using password: YES)
huang是我电脑的主机名
jdbc.properties配置如下
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/abc
user=root
password=123456
spring中的bean配置
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${driver}"></property>
<property name="url" value="${url}"></property>
<property name="username" value="${user}"></property>
<property name="password" value="${password}"></property>
<property name="maxIdle" value="10"></property>
<property name="initialSize" value="5"></property>
</bean>