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 ' root ' @ ' localhost ' (using Password:yes)
# # # The error may exist in Com/sample/mappers/employeemapper.xml
# # # The error may involve Com.sample.dao.EmployeeDao.listall
# # # 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 ' root ' @ ' localhost ' (using Password:yes)
Notice:the user is ' root ' not ' root '
The problem is roughly the need to check your data source configuration as in resource: Url,username,password
URL This is generally "jdbc:mysql://localhost:3306/test", must pay attention to 3306, this is your database connection with the port, you can change it to another, but if you use the Tomcat container, do not write it 8080, This will produce cannot create poolableconnectionfactory (Communications link failure problem, and there is url=jdbc:mysql://localhost:3306/ The localhost in test is not a random configuration, it depends on the from host in your database
I was really in MySQL Workbench5.2 ce in the Users and privileges, there is a server Access Management
User from host you see there is no localhost in host, if you can write url=jdbc:mysql://localhost:3306/test, if from Host has 127.0.0.1 words, can also be written url=jdbc:mysql://127.0.0.1:3306/test
There is username= this must be written correctly, I was writing is name=, the results of MySQL can not find username, and then he automatically set the username as "", so that the error hint: java.sql.SQLException:Access Denied for user ' @ ' localhost ' (using password:yes) do you see that the @ front is two single quotes, that is I did not input username and led to default default username, in fact, this error can also be changed with the set permissions, But that's MySQL content, don't say it.
Summed up is: the URL port to write to, can not write other programs are occupied, 127.0.01 or localhost to see which of the database, but also to put the driver into the project in the Web-inf/lib, here to mention do not put into Tomcat lib.
MyBatis connection Error Cannot create poolableconnectionfactory (Access denied for user ' root ' @ ' local