mysql Access denied for user 'root'@'localhost' (using password: NO)

一笑奈何 提交于 2019-12-20 06:25:21

问题


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.

<property name="eclipselink.jdbc.user" value="root"/>
<property name="eclipselink.jdbc.password" value="password"/>

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!!


回答1:


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.



来源:https://stackoverflow.com/questions/18693149/mysql-access-denied-for-user-rootlocalhost-using-password-no

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!