mysql root 访问被拒绝_用户'root'@'localhost'的mysql访问被拒绝(使用密码:否)

I'm using Netbean 7.3, Glassfish 3.1.2

I always get this error and I cannot proceed to do my project:

WARNING: RAR5038:Unexpected exception while creating resource for pool mysql_tests_rootPool. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: Access denied for user 'root'@'localhost' (using password: NO)

WARNING: RAR5117 : Failed to obtain/create connection from connection pool [ mysql_tests_rootPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: Access denied for user 'root'@'localhost' (using password: NO)

WARNING: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause:

Connection could not be allocated because: Access denied for user 'root'@'localhost' (using password: NO)]

Error in getList() -->Error in allocating a connection. Cause: Connection could not be allocated because: Access denied for user 'root'@'localhost' (using password: NO)

Initially my project cannot even run. But after including these 2 line of code under persistence.xml, my project can run, but it can only access the database once.

I included "root" and "password" when doing all the setup etc but still, I'm getting this error. Tried a lot of methods but none works!

Please help!

Thanks!!

解决方案

I've solved this error. I'm posting this because someone could have encounter the same thing as me.

The problem lies with the data source. Apparently something happen during the creation of data source. The password parameter is missing. So I deleted the current data source and created a new one again and the problem is solved.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值