Installing Mysql on Ubuntu linux

Mono

courtesy

SQL server is considered the best database for .NET on Windows. In my personal opinion, the analogy with Mono is MySql.

In this post, we’ll see how to setup it and it’s connector on Ubuntu.

I was trying to do some Mysql, to support a project which need it and can run on .NET on Ubuntu linux. In an effort to get everything out of Windows.

During the process, the software center had some fever:

Ubuntu software center greyed out

Initially, I tried individual installations of Workbench and Mysql from APT. However, since I was not 100% sure (and the above eclipse), I just purged everything and followed the sure way.

Setup Mysql on Ubuntu

Installed mysql server using command sudo apt-get install mysql-server

Gave password (and forgot):

Enter mysql root password

Re-enter mysql root password

Set up terminal client using sudo apt-get install mysql-client, which can be accesed as root by using command mysql -u root -p

run Mysql from terminal

And/Or from UI using sudo apt-get install mysql-workbench

Accessing Mysql from workbench

Setting up Mysql connector

Go here to download the connector. Select .NET & Mono platform and initiate download process.

Extract the downloaded file and move it to your directory of preference.

An inside view of the directory will look like this:

0

cd to the directory and ensure that MySql.Data.dll indeed exists by using ls command. I went to v4.5 to make sure that I have all the new patches.

Use command sudo gacutil /i MySql.Data.dll to register it to Global Assembly Cache (GAC)

1

To confirm registration:

  • Go to directory /usr/lib/mono/gac by using command cd /usr/lib/mono/gac
  • List it’s contents by using command ls

You will find MySql.Data if the registration has been successful.

MySql Mono connector registered in GAC

I tried following official installation instruction but didn’t found it perfect, the above steps were tried on 64bit Ubuntu 14.6.

Photos