Showing entries 1 to 2
Displaying posts with tag: charp (reset)
Using MySqlClientPermission Class on Connector/Net 6.5 to restrict data access

The release of the new 6.5 Connector/Net version includes a MySqlClientPermission class to help all the users define the security polices to use in the database connections within any application using a MySQL database.

Using MySqlClientPermission Class on Connector/Net 6.5 to restrict data access

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]
Showing entries 1 to 2