Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

Connecting to a MYSql Database

This is my code:

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/coinzilla?user=administrator&password=password");

This is the error i get:

Access denied for user ''@'miller.virtual.vps-host.net' to database 'coinzilla' 42000 1044

I have doubled checked the username and password multiple times. Is there anything else that could be causing the error?
0
MistahMilla
Asked:
MistahMilla
  • 4
  • 3
1 Solution
 
objectsCommented:
try:

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/coinzilla", "administrator", "password");
0
 
MistahMillaAuthor Commented:
Tried that just now... almost the same error.

Access denied for user 'administrator'@'miller.virtual.vps-host.net' (using password: YES) 28000 1045

Just the numbers at the end are different.
0
 
objectsCommented:
> Just the numbers at the end are different.

No the user is also different, and also the password is now being used.
Check that that user has access to the database.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
MistahMillaAuthor Commented:
I'm pretty sure that it does have access to the database.

http://miller.virtual.vps-host.net/priv.jpg
0
 
objectsCommented:
thats administrator@localhost, not administrator@miller.virtual.vps-host.net
0
 
MistahMillaAuthor Commented:
Thanks... i'm a moron
0
 
objectsCommented:
don't be so hard on yourself :)
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now