Estoy intentando acceder a un servidor de mysql mediante c#. Los datos de conexión y credenciales son correctos ya que puedo connectar mediante gestor de base de datos. Agradecería vuestra ayuda
privateKeyLocation = @"C:\rutafichero\ssh1";
var sshServer = "155.90.155.90";
var sshUserName = "usuario_ssh";
var sshPassword = "";
var databaseServer = "10.0.0.9";
var databaseUserName = "usuariob_bdd";
var databasePassword = "clave_bbdd";
var pk = new PrivateKeyFile(privateKeyLocation);
var keyFiles = new[] { pk };
var methods = new List<AuthenticationMethod>();
methods.Add(new PrivateKeyAuthenticationMethod(sshUserName, keyFiles));
var con = new ConnectionInfo(sshServer, 3306, sshUserName, methods.ToArray());
using (var sshClient = new SshClient(con)){
sshClient.Connect();
string connectionString = "datasource=10.0.0.9;port=3306;username=databaseUserName;password=databasePassword ;database=project;";
string query = "SELECT * FROM tabla";
MySqlConnection databaseConnection = new MySqlConnection(connectionString);
MySqlCommand commandDatabase = new MySqlCommand(query, databaseConnection);
commandDatabase.CommandTimeout = 60;
MySqlDataReader reader;
}