We have a new feature as part of the 6.5 release. There is a new class that you can use to restrict access to specific connection strings that you want to use in all the connections in applications that use MySQL databases.
The following example shows how you can use the MySQLClientPermission class to restrict access to a specific server name and a database, while allowing any value for the User Id and Password within the connection string:
MySqlClientPermission permission = new MySqlClientPermission(PermissionState.None);
permission.Add("server=localhost;database=test;", " user id=; password=;",
KeyRestrictionBehavior.AllowOnly);
permission.PermitOnly();
MySqlConnection myconn = new MySqlConnection();
myconn.ConnectionString = "server=localhost; user id=QueryUser; database=test;";
myconn.Open(); // Attempt to use the connection string
The first line of …
[Read more]