There is no installer available for installing the Connector/Net component on your Unix installation. Before installing, ensure that you have a working Mono project installation. To test whether your system has Mono installed, enter:
shell> mono --version
The version of the Mono JIT compiler is displayed.
To compile C# source code, make sure a Mono C# compiler is
installed. Note that there are two Mono C# compilers available,
mcs, which accesses the 1.0-profile libraries,
and gmcs, which accesses the 2.0-profile
libraries.
To install Connector/Net on Unix/Mono:
Download the
mysql-connector-net-
and extract the contents to a directory of your choice, for
example: version-noinstall.zip~/connector-net/.
In the directory where you unzipped the connector to, change
into the bin subdirectory. Ensure the
file MySql.Data.dll is present. This
filename is case-sensitive.
You must register the Connector/Net component,
MySql.Data, in the Global Assembly Cache
(GAC). In the current directory enter the
gacutil command:
root-shell> gacutil /i MySql.Data.dll
This will register MySql.Data into the GAC.
You can check this by listing the contents of
/usr/lib/mono/gac, where you will find
MySql.Data if the registration has been
successful.
You are now ready to compile your application. You must ensure
that when you compile your application you include the
Connector/Net component using the -r:
command-line option. For example:
shell> gmcs -r:System.dll -r:System.Data.dll -r:MySql.Data.dll HelloWorld.cs
Note, the assemblies that are referenced depend on the
requirements of the application, but applications using
Connector/Net must provide -r:MySql.Data as a
minimum.
You can further check your installation by running the compiled program, for example:
shell> mono HelloWorld.exe

User Comments
For my Fedora Core 6 system I used the following.
1. http://dev.mysql.com/downloads/connector/net/1.0.html "Windows Source and Binaries, no installer (ZIP) 1.0.7 (GA)"
2. # cp /home/dalem/Desktop/mysql-connector-net/bin/mono-1.0/release/MySql.Data.dll /usr/lib/mono/1.0/
# chcon -u system_u -t lib_t /usr/lib/mono/1.0/MySql.Data.dll
3. # pushd /usr/lib/mono/1.0/
# gacutil /i MySql.Data.dll
MySql.Data installed into the gac (/usr/lib/mono/gac)
Then tested with http://www.mono-project.com/MySQL.
OpenSuse 11.1 story:
After downloading .NET connector 6.0.3 my directory didn't contain MySql.Data.dll ... but it DID contain mysql.data.dll. I went through all of the motions on the instruction page (substituting lowercase for upper) to no avail.
Finally, I renamed mysql.data.dll to MySql.Data.dll and went through the motions again -> VOILA. Only problem is that then the installed package looks for mysql.data.dll.
The gist of this is, #>cp mysql.data.dll MySql.Data.dll
#>gacutil -i MySql.Data.dll
You may also need to copy mysql.data.dll to /usr/lib/mono/<version>
Milo
Thanks a lot Jeremy, I was trying to make it work using mysql.data.dll but no success.
Finally, renaming to MySql.Data.dll and installing it made it work.
To get the connector to be fully usable under Mono 2.4 on Ubunbtu and monodevelop 2.2, I had to do the same as explained above (produce MixedCase copies of the files) and install with:
gacutil -i -package 2.0 MySql.Data.dll
This installs in the GAC and also adds a symlink in /usr/lib/mono/2.0 (or wherever your Mono installation is set up). If monodevelop won't see the assembly, then you can add a reference to the dll in /usr/lib/mono/2.0 (monodevelop is picky about which assemblies it'll show references to).
Note that under Mono the data provider must also be added to the machine.config file:
http://stackoverflow.com/questions/3987266/mysql-connector-with-mod-mono-and-mono-2-6-7
On my Linux box running Ubuntu 12.04, I had to rename the connector.net/mysql.data.dll to mixed case MySql.Data.dll, and then register with the gac. I used the v4 folder, no the v2.
Add your own comment.