mono mysql_为Mono安装MySql连接驱动

为Mono安装MySql连接驱动(转)

DOTNET and Mono by default only support database connections to the Microsoft SQL Server through System.Data.SqlClient module. To make a connection to the MySQL server you need a connector module from MySQL.

Proceed with the following steps to obtain and install the MySQL .NET Connector:

1. Downloading MySQL .NET Connector

Either from MySQL (requires registration):

http://www.mysql.com/downloads/mirror.php?id=399565

or directly from one of the mirros:

ftp://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-Net/mysql-connector-net-6.3.6-noinstall.zip

2. Unzip the content into a directory

~> md connector

~> cd connector

~/connector> unzip ../mysql-connector-net-6.3.-noinstall.zip

~/connector> ls

CHANGES COPYING MySql.Data.chm README Release Notes.txt v2 v4

3. Change names of assemblies to proper names

~/connector> cd v2

~/connector/v2/ mv mysql.data.cf.dll MySql.Data.Cf.dll

~/connector/v2> mv mysql.data.dll MySql.Data.dll

~/connector/v2> mv mysql.data.entity.dll MySql.Data.Entity.dll

~/connector/v2> mv mysql.visualstudio.dll MySql.VisualStudio.dll

~/connector/v2> mv mysql.web.dll MySql.Web.dll

~/connector/v2> cd ../v4

~/connector/v4> mv mysql.data.dll MySql.Data.dll

~/connector/v4> mv mysql.data.entity.dll MySql.Data.Entity.dll

~/connector/v4> mv mysql.visualstudio.dll MySql.VisualStudio.dll

~/connector/v4> mv mysql.web.dll MySql.Web.dll

4. Copy assemblies into library directory of your mono installation

~/connector/v4> su

/home/user/connector/v4 # cp MySql.* /usr/lib/mono/4.0/.

/home/user/connector/v4 # cd ../v2

/home/user/connector/v2 # cp MySql.* /usr/lib/mono/2.0/.

5. Register the installed assemblies in the global assembly cache

~ # cd /usr/lib/mono/4.0

/usr/lib/mono/4.0 # gacutil -i MySql.Data.dll

/usr/lib/mono/4.0 # gacutil -i MySql.Data.Entity.dll

/usr/lib/mono/4.0 # gacutil -i MySql.VisualStudio.dll

/usr/lib/mono/4.0 # gacutil -i MySql.Web.dll

/usr/lib/mono/4.0 # cd ../2.0

/usr/lib/mono/2.0 # gacutil -i MySql.Data.Cf.dll

/usr/lib/mono/2.0 # gacutil -i MySql.Data.dll

/usr/lib/mono/2.0 # gacutil -i MySql.Data.Entity.dll

/usr/lib/mono/2.0 # gacutil -i MySql.VisualStudio.dll

/usr/lib/mono/2.0 # gacutil -i MySql.Web.dll

Note: For steps 3 (renaming) and 4 (copying), I don’t really understand why these steps are necessary, but on my OpenSuSE 11.3 machine it did only work out that way. Any suggestions to improve this procedure are welcome.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值