Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the error I get when trying to run the application. It works just fine locally, however when I try to remote to the database I get this message.

Error:Authentication to host 'xxx.xxx.xxx.xxx' for user 'xxxxx' using method 'mysql_native_password' failed with message: Access denied for user 'xxxx'@'rrcs-50-84-221-19.sw.biz.rr.com' (using password: YES)

The IT guy says that he has given me access to the database and has all the permissions set on his side. I still cannot get into it.

Here is my data for connection string:
all varibles are set correctly. <- double checked and then checked again
connectData = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

MySqlConnection connect = new MySqlConnection(connectData);
try
{
connect.Open();

Any help would be greatly appreciated. Thanks in advance.
Posted
Comments
ZurdoDev 26-Aug-13 10:55am    
Well, the error is clear. Access is denied.
[no name] 26-Aug-13 11:20am    
http://www.connectionstrings.com/mysql/
RGolightly 26-Aug-13 11:48am    
Thanks for your quick response Biopelo.
Yes, the username and password are correct I can login using phpmyadmin with no issues. I have tried testing on live production as well, same error.

I will be sending the program over for him to run live on his system now. He has assured me that he has allowed remote access. Using this type command.

GRANT ALL PRIVILEGES ON xxxxxx.* TO ‘xxxxxxx’@’%’ IDENTIFIED BY ‘xxxxxx’;
.
.
.
In the error message I get the part that has me thinking its not getting our correct IP address.
"Access denied for user 'xxxx'@'rrcs-50-84-221-19.sw.biz.rr.com'"
yes the xxx i blocked out but the rest rrcs-50..... yes it resolves to our IP address but would that make any difference? This is my first program connecting to a database sorry for the lack of knowledge.

thanks again.
Boipelo 26-Aug-13 16:06pm    
You did comment to my answer, So, I didn’t see your comment. I only visited your post to check if you managed to resolve it.

Don’t send them the program, only ask him to visit your site and log on if need to be logged to, you will have to give him a password, you can change it later.
I didn’t notices ‘’rrcs-50-84-221-19.sw.biz.rr.com”, yes it will make a difference; I wonder why to your IP address you didn’t specify it on your connection string. One last thing, check if they are using ports and that that to the connection string.

SaqibRasheed859 (solution 2) gave a proper advise, only them can resolve the issue, you have access rights issues. Send them your error message and they should be able to help.
ThePhantomUpvoter (above comment) provided send you a useful link regarding mysql connection strings.
RGolightly 27-Aug-13 11:22am    
I have contacted them and they keep telling me that they ran this Grant Command
GRANT ALL ON xxxx.* TO xxxx@% IDENTIFIED BY 'xxxxx';
Obviously with the xxxx containing the correct databasename, user, and password.
does having the rrcs-50.x....sw.biz.rr.com in the error message look ok to you? or should it just contain our ip address?? If there is a problem with that how would I go about fixing that inside the program? I cant find anything that lets you control what is being sent over to the server.???/

Assuming you username and passwords are correct, if you running the application from your side check if they allow remote access, also test on live production - same same error?

Also ask you IT Guys to also run your live application and sent you a screen shot of the error -- I have a feeling that they don't allow remote access. My hosting company doesn't allow it on some packages the sell.
 
Share this answer
 
The error message you have specified clearly says that "Access denied for user 'xxxx'@'rrcs-50-84-221-19.sw.biz.rr.com'. This means you still don't have access to the machine. Consult the support guys again and send them that error. Only they can help you resolve this issue.
 
Share this answer
 
Comments
RGolightly 27-Aug-13 11:21am    
I have contacted them and they keep telling me that they ran this Grant Command
GRANT ALL ON xxxx.* TO xxxx@% IDENTIFIED BY 'xxxxx';
Obviously with the xxxx containing the correct databasename, user, and password.
does having the rrcs-50.x....sw.biz.rr.com in the error message look ok to you? or should it just contain our ip address?? If there is a problem with that how would I go about fixing that inside the program? I cant find anything that lets you control what is being sent over to the server.???/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900