Oracle 5.0 Reference Manual page 1954

Table of Contents

Advertisement

<policy>
<PolicyLevel version="1">
<SecurityClasses>
....
<SecurityClass Name="MySqlClientPermission" Description="MySql.Data.MySqlClient.MySqlClientP
Scroll down to the
ASP.Net
<PermissionSet
class="NamedPermissionSet"
Add a new entry for the detailed configuration of the
<IPermission class="MySqlClientPermission" version="1" Unrestricted="true"/>
Note: This configuration is the most generalized way that includes all keywords.
3. Configure the MySQL server to accept pipe connections, by adding the
option on the command line. If you need more information about this, see
MySQL on Microsoft
Windows".
4. Confirm that the hosting provider has installed the Connector/Net library (MySql.Data.dll) in the
GAC.
5. Optionally, the hosting provider can avoid granting permissions globally by using
the new
MySqlClientPermission
is to globally enable the permissions System.Net.SocketPermission,
System.Security.Permissions.ReflectionPermission, System.Net.DnsPermission,
and System.Security.Permissions.SecurityPermission.)
6. Create a simple web application using Visual Studio 2010.
7. Add the reference in your application for the
8. Edit your
web.config
<system.web>
<trust level="Medium"/>
</system.web>
9. Add the
MySql.Data.MySqlClient
10. Define the connection string, in slightly different ways depending on the Connector/Net version.
Only for 6.6.4 or later: To use the connections inside any web application that will run in
Medium trust, add the new
includesecurityasserts=true
when required: SocketPermissions, ReflectionPermissions, DnsPermissions,
SecurityPermissions
For Connector/Net 6.6.3 or earlier: No special setting for security is needed within the connection
string.
MySqlConnectionStringBuilder myconnString = new MySqlConnectionStringBuilder("server=localhost;User Id=r
myconnString.PipeName = "MySQL55";
myconnString.ConnectionProtocol = MySqlConnectionProtocol.Pipe;
// Following attribute is a new requirement when the library is in the GAC.
// Could also be done by adding includesecurityasserts=true; to the string literal
// in the constructor above.
// Not needed with Connector/Net 6.6.3 and earlier.myconnString.IncludeSecurityAsserts = true;
11. Define the
MySqlConnection
MySqlConnection myconn = new MySqlConnection(myconnString.ConnectionString);
Connector/Net Programming
section:
version="1"
class in the trust policies. (The alternative
MySql.Data.MySqlClient
file so that your application runs using a Medium trust level:
namespace to your server-code page.
includesecurityasserts
that makes the library request the following permissions
among others that are not granted in Medium trust levels.
to use:
1934
Name="ASP.Net">
MySqlClientPermission
--enable-named-pipe
Section 2.10, "Installing
library.
option to the connection string.
class:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents