I have a remote hosted website with a MySQL
database.
I am trying to access that database from a small C#
program.
What I've tried:
Remote MySQL Databases
in the site's cPanelWhat I'm getting:
What boggles my mind:
LATER EDIT:
Interesting enough. If I do
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' WITH GRANT OPTION;
it throws me this:
#1045 - Access denied for user 'blabla'@'localhost' (using password: YES)
Common sense should tell you that my username is not actually 'blabla'.
LATER LATER EDIT:
I don't have privileges to CREATE USER, nor do I have SSH access via PuTTy or so.
Does this basically mean that it's my hosting's fault that I can't connect from a remote location to the DB?
Have a look at the users in your mysql database. A couple things to check:
With cPanel on shared hosting, if you create a user named blah
the actual name of the user in mysql is often unixusername_blah
. This is done automatically to prevent MySQL user name conflicts between different cPanel accounts sharing the same MySQL server.
With MySQL you can define which hosts a user is allowed to connect from. Is the new user you defined allowed to connect from your IP?
ETA:
Might want to have a look at the permissions for that user account and make sure appropriate permissions are granted. You can do this by running the following in phpMyAdmin or at the console:
SHOW GRANTS FOR 'something_root'@'localhost'
And compare the grants you see there to what you get here:
SHOW GRANTS FOR 'something_root'@'%'
Finally, depending on your hosting environment you may not have permissions to create new users or expand their privileges enough to be able to do this. This would be particularly likely if you have a shared hosting account.