-1

I want to connect mysql database to a project in netbeans. I tried few ways but while running the application i am getting error as

u Access denied for user 'User'@'localhost' (using password: YES) 
I think my way of connecting may be wrong. Give me information regarding that. My localhost is running in 8080 and mysql which i connected is running in 3306 port. Can anyone give exact steps for connecting database to my applicaiton

4
  • example: tutorialspoint.com/jdbc/jdbc-sample-code.htm Commented Mar 8, 2016 at 8:45
  • Please post your Code.. I think you should check your password what you r passing as a Parameter. Commented Mar 8, 2016 at 8:47
  • @TomN my question is regarding connection in netbeans not in normal java program using jdbc drivers. Commented Mar 8, 2016 at 8:50
  • then: netbeans.org/kb/docs/ide/mysql.html Commented Mar 8, 2016 at 8:53

1 Answer 1

1

If you want to connect Mysql database with NetBeans then please follow below steps.

1. In the Services window you can right click on the Databases tab and select New Connection.

2. Select MySQL(Connector/J Driver) from the drop-down list. The driver file should be listed in the window. If not, you can download the file, then click add and select it from your hard drive.

3. Finally enter your database details such as servername, username and password and click finish.

for more detail check HERE

For PHP check this link connect it with your PHP application

Let me know in which language you are trying to connect mysql database?

Sign up to request clarification or add additional context in comments.

4 Comments

I followed the same process but getting same error as before
have you verified the password of that user from mysql database? and also do that user has permission of localhost?
after creating database who to linkup with application (without using code)
by default root user has permission of all databases. Please try to connect your application with root user and use same password which you use to open phpmyadmin. If you have created new database user then give permission to that user. You can find detail in this link digitalocean.com/community/tutorials/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.