Is there a way to connect to a MySQL database without ssl?


I'm trying to connect to a local MySQL DB.

I have this connector:

using(MySqlConnection conn = new MySqlConnection("Database=Studentenverwaltung;Port=3306;Data Source=;User Id=root;Password=abc123")) 
    catch(Exception e) 
        Console.WriteLine("Cannot open Connection");

But I get this Exception:

MySql.Data.MySqlClient.MySqlException (0x80004005): The host does not support SSL connections.

It seems that it cannot connect to the DB because the DB doesn't support SSL. So is there a way how to connect to the DB whithout SSL?

asked on Stack Overflow May 27, 2018 by Stefan • edited May 27, 2018 by Camilo Terevinto

2 Answers


Have you tried to set the SslMode property to 'none' in your connection string?

This should work:

new MySqlConnection("Database=Studentenverwaltung;Port=3306;Data Source=;User Id=root;Password=abc123;SslMode=none;")
answered on Stack Overflow May 27, 2018 by Kjell Derous • edited Aug 24, 2020 by Guido Leenders
using MySql.Data.MySqlClient;

private const String SERVER = "";         // Server IP
private const String DATABASE = "abc";           // Date base name
private const String TABLE = "test";             // Table name
private const String UID = "user";               // Date base username
private const String PASSWORD = "pass";          // Date base password

public static void InitializeDataBase()
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();

builder.Server = SERVER;
builder.UserID = UID;
builder.Password = PASSWORD;
builder.Database = DATABASE;
builder.SslMode = MySqlSslMode.None;
//builder.CertificateFile = @"<Path_To_The_File>\client.pfx";
//builder.CertificatePassword = "<Password_For_The_Cert>";

String connString = builder.ToString();
builder = null;

dbConn = new MySqlConnection(connString);         
answered on Stack Overflow Mar 4, 2019 by Adzislaw • edited Mar 4, 2019 by Adzislaw

User contributions licensed under CC BY-SA 3.0