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=;",
MySqlConnection myconn = new MySqlConnection();