用户'root'@'localhost'的mysql访问被拒绝(使用密码:否) [英] mysql Access denied for user 'root'@'localhost' (using password: NO)

查看:781
本文介绍了用户'root'@'localhost'的mysql访问被拒绝(使用密码:否)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Netbean 7.3,Glassfish 3.1.2

I'm using Netbean 7.3, Glassfish 3.1.2

我总是会收到此错误,因此无法继续执行我的项目:

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

警告:RAR5038:为池mysql_tests_rootPool创建资源时发生意外异常.异常:javax.resource.spi.ResourceAllocationException:无法分配连接,因为:用户'root'@'localhost'的访问被拒绝(使用密码:NO)

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)

警告:RAR5117:无法从连接池[mysql_tests_rootPool]获取/创建连接.原因:com.sun.appserv.connectors.internal.api.PoolingException:无法分配连接,因为:用户'root'@'localhost'的访问被拒绝(使用密码: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)

警告:RAR5114:分配连接时出错:[分配连接时出错.原因: 无法分配连接,因为:用户'root'@'localhost'的访问被拒绝(使用密码: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)]

getList()中的错误->分配连接时发生错误.原因:无法分配连接,因为:用户'root'@'localhost'的访问被拒绝(使用密码: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)

最初,我的项目甚至无法运行.但是在persistence.xml下包含这两行代码后,我的项目可以运行,但只能访问数据库一次.

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"/>

在进行所有设置等操作时,我包括了"root"和"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!

请帮助! 谢谢!

推荐答案

我已经解决了该错误.我发布此邮件是因为有人可能会遇到与我相同的事情.

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.

这篇关于用户'root'@'localhost'的mysql访问被拒绝(使用密码:否)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆