Link to home
Start Free TrialLog in
Avatar of MistahMilla
MistahMilla

asked on

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?
Avatar of Mick Barry
Mick Barry
Flag of Australia image

try:

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/coinzilla", "administrator", "password");
Avatar of MistahMilla
MistahMilla

ASKER

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.
> 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.
I'm pretty sure that it does have access to the database.

http://miller.virtual.vps-host.net/priv.jpg
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks... i'm a moron
don't be so hard on yourself :)