1

I have a remote server hosting an application with a MySQL Database attached. I am trying to write a program to automated a process on the server. This required me to make a connection over SSH then connect and query the MySQL database.

Using Putty I can make a connection and connect to the database using the command "mysql -u root -p blah" and query all I wish.

However, from my .NET application when I try to make a connection using sharpSSH and a connection string to MySQL I get the error :

"access denied for user 'root'@'localhost' (using password yes)"

Can it be an permission issue if I can connect using Putty or could it be a issue with one of the tools I am using?

The guide I followed can be found here - http://georgelantz.com/2007/09/10/access-mysql-through-ssh-tunnel-in-a-windows-net-application/

Freelancer
  • 9,008
  • 7
  • 42
  • 81
Jonoh89
  • 35
  • 6
  • Check the MySQL password in connection string. – Devart Apr 03 '13 at 09:21
  • No the password is correct as it works for putty. In the config the bind-address = 127.0.0.1. Does this need to be the address of the machine on the network or should it work as it is working through putty. – Jonoh89 Apr 03 '13 at 11:16
  • You managed to connect to MySQL server, the problem is the password for user 'root'@'localhost'. Note, there can be one more root user with another password, e.g. - 'root'@'%'. – Devart Apr 03 '13 at 11:46
  • Yep, I just created a new user for this particular project, granted permissions and all is good! Thanks for the pointers. – Jonoh89 Apr 03 '13 at 13:05

0 Answers0