我一直在试图用建立在GlassFish的MySQL数据库连接池,但它不断出现这条消息:GlassFish和MySQL连接池
连接无法分配的原因是:拒绝访问用户“@”本地主机”(使用密码:NO)
这是在GlassFish-resources.xml中的连接网址:
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="connectionPool" non-transactional-connections="true" ping="true" pool-resize-quantity="2" pooling="true" res-type="javax.sql.ConnectionPoolDataSource" statement-cache-size="0" statement-leak-reclaim="false" statement-leak-timeout-in-seconds="0" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="true">
<property name="URL" value="jdbc:mysql://localhost:3306/testDB"/>
<property name="User" value="root"/>
<property name="Password" value="mypasswordgoeshere"/>
我张贴这种问答之前看了很多文章问题,其中许多人建议编辑mysql.users表和添加密码根,但我使用MySQL的版本5.7.7的'密码'列被删除。
我也使用NetBeans 8.0.2来创建连接池和GlassFish 4.1,我正在使用JSF2.0和PrimeFaces处理Maven项目,服务器启动并正常运行。
另一个奇怪的事情是,GlassFish显示我的项目已经部署,但它说该页面找不到。
对不起,我没有抄袭这一切,这里的休息: <属性名=“密码”值=“mypasswordgoeshere” /> JDBC连接池> –