aspose file tools
The moose likes IDEs, Version Control and other tools and the fly likes Unable to connect to MYSQL through eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "Unable to connect to MYSQL through eclipse" Watch "Unable to connect to MYSQL through eclipse" New topic
Author

Unable to connect to MYSQL through eclipse

ujwwala tem
Ranch Hand

Joined: Feb 10, 2010
Posts: 66

Hello,

I have Mysql5.1.41 win 32,I am able to start the server throgh command prompt, and I have a mysql-connector-java-5.1.10-bin.jar which I have place in common/lib of tomcat as well as lib/ext but when I craete new database connection with this driver,I am not able to connect to MYSQL.



java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3996)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2142)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:781)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:348)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)
at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:89)
at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:104)
at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:53)
at org.eclipse.datatools.enablement.internal.mysql.connection.JDBCMySQLConnectionFactory.createConnection(JDBCMySQLConnectionFactory.java:28)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)
at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:355)
at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)
at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Please help
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 419

ujwwala tem wrote:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)

Seems like you have to provide a password for the user "root". Or use another user who does not need a password (even though it's bad practice).
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

Actually, you can also get this message when the user/source combination aren't allowed rights, even when the password is correct. MySQL Is very picky about who can access what and how they can access it.

MySQL as it comes "out of the box" usually is set up to authenticate root with no password required when logging in from localhost, but that's not considered to be very good practice, so often a password is assigned by a database administrator.

However, since the root account is normally capable of doing every dangerous thing in the book, MySQL-wise, it's not recommended to use it for applications. You should set up a separate non-root account for that purpose, and grant it access to the application database resources as appropriate.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
ujwwala tem
Ranch Hand

Joined: Feb 10, 2010
Posts: 66
Thanks,

I am able to connect now,I have created a new user.
 
 
subject: Unable to connect to MYSQL through eclipse
 
Threads others viewed
connection of eclipse helios and mysql
Eclipse + MySQL = cannot connect
SQL formatting question
Function does not exist
Function does not Exist
developer file tools