wood burning stoves 2.0*
The moose likes JForum and the fly likes java.sql.SQLException: Access denied Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "java.sql.SQLException: Access denied" Watch "java.sql.SQLException: Access denied" New topic
Author

java.sql.SQLException: Access denied

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi~ When i try to install JForum i got a problem with access denied

my failure log is like this

_________________________________________________________________________________

com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user 'root'@'myip' (using password: YES)'.

** BEGIN NESTED EXCEPTION **

java.sql.SQLException
MESSAGE: Access denied for user 'root'@'myip' (using password: YES)

STACKTRACE:

java.sql.SQLException: Access denied for user 'root'@'myip' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2772)
at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at net.jforum.SimpleConnection.getConnection(SimpleConnection.java:93)
at net.jforum.SimpleConnection.init(SimpleConnection.java:74)
at net.jforum.view.install.InstallAction.configureDatabase(InstallAction.java:593)
at net.jforum.view.install.InstallAction.doInstall(InstallAction.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.jforum.Command.process(Command.java:117)
at net.jforum.view.install.InstallAction.process(InstallAction.java:807)
at net.jforum.InstallServlet.service(InstallServlet.java:140)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)


** END NESTED EXCEPTION **


_______________________________________________________________________________



i put correct id and password but i can not install so i surveyed in this site whick symptoms like those of mine

http://www.coderanch.com/t/575243 ;jsessionid=1ptd39komdw58.jetty1

and that solution was

correct mysql.properties file (/WEB-INF/config/database/mysql)

but, i can not find what wrong with my mysql.properties file



my file is like this

___________________________________________________________________


[root@localhost mysql]# vi mysql.properties
#Thu May 07 15:05:23 KST 2009
database.connection.password=123
database.connection.dbname=jforum
database.support.autokeys=true
database.connection.host=secret
mysql.unicode=
database.connection.pool.min=5
database.support.subqueries=true
database.connection.pool.timeout=5000
database.connection.port=3306
database.connection.username=root
dbencoding=utf-8
database.connection.string=jdbc\:mysql\://${database.connection.host}\:${database.connection.port}/${database.connection.dbname}?user\=${database.connection.username}&password\=${database.connection.password}&autoReconnect\=true${mysql.unicode}${mysql.encoding}&useNewIO\=false&zeroDateTimeBehavior\=convertToNull&useServerPrepStmts\=false&dumpQueriesOnException\=true&jdbcCompliantTruncation\=false
database.connection.pool.max=10
dao.driver=net.jforum.dao.mysql.MysqlDataAccessDriver
mysql.encoding=
dbunicode=true
database.connection.driver=com.mysql.jdbc.Driver


_____________________________________________________________________


how must i correct this file??

please answer me

thank you~






[originally posted on jforum.net by honghoekim]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
"Access denied" means that you connected to the MySQL server so it's not a bad host name or firewall blocking issue. It knows your user id and I assume that the password is correct.

There are a couple of things that come to mind based on this. First, the root id may be limited to only be allowed access with a "localhost" server name. FWIW, best practice is not to use root for applications but to create a separate application specific id with rights only to the application DB.

Second, you might need to adjust your MySQL JDBC drivers. Older versions of MySQL used unencrypted passwords. These can fail with the newer JDBC drivers which encrypt them. Also, if your MySQL server is new and the driver is old, this can happen too.

[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I solved my problem!!

It was because of my host name.

I replaced it with 'ip address' to 'localhost'

anyway thank you~
[originally posted on jforum.net by honghoekim]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: Access denied