i was using mysql to connect to database in java. but it is throwing an error that is" access denied for use' '@'localhost' to database 'onlinetest'
while installing mysql I DIDNT PROVIDED ANY USERNAME AND PASSWORD, IS THERE ANY PROBLEM WITH USER AND PASS AND WHAT TO WRITE IN USER AND PASS DURING CODING, IN JDBC

user name root
password ""
u have to give all privilege to all user in mysql

user name root
password ""
u have to give all privilege to all user in mysql

yep2, this is how you do it..

No it is not. You should read the mysql user manual (and pay close attention to the part about grants) and give the root login a password (or restrict it to only the unix socket connection), delete the "blank" user account, and create an application user for your application.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.