-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我jdbc.properties里的usename写的是root为啥debug queryById的时候报错Access denied for user 'JAY'@'localhost' (using password: YES)。。。我是小白。。 #9
Comments
这是因为你数据库没连接上,用户名或者密码错了。小白的话去网上看看如何配置mysql的
发自网易邮箱大师
在2017年04月15日 22:24,tmlvampire 写道:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
数据库我确定是对的 因为不用配置文件的话就连上了。。。。。。用了jdbc,properties就报这个错。。好奇怪 |
既然能连上那应该不是数据库没打开的缘故,估计是你的spring配置文件中没有将jdbc.properties正确的配置上,再检查下你的resources包下的spring-dao文件试试 |
spring-dao.xml中,用了${username}之后它好像会取当前计算机用户名来连数据库,spring-dao.xml和jdbc.properties的中username改成user就好使了,希望能帮到你们。 |
啊哈这种错误我不清楚,不过好像又长了新姿势哈!那使用${username}不能成功连接数据库的建议将参数username换成user试试,谢谢这位小兄弟! |
亲测有效,spring-dao.xml和jdbc.properties的中username改成user有用,谢谢各位帮忙解决的层主 |
不能用username做key |
mac中应该好的 |
就是 |
你们怎么运行的啊,数据库都没有啊 |
楼上说的都对的,用户名被覆盖了,一般我写jdbc.properties的时候都会加上jdbc. 的前缀,个人认为比较规范。 |
No description provided.
The text was updated successfully, but these errors were encountered: