Installing Mysql on Ubuntu linux

Written by xameeramir | Published 2017/12/25
Tech Story Tags: ubuntu | mysql | linux | installation

TLDRvia the TL;DR App

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:

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.

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

Gave password (and forgot):

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

And/Or from UI using sudo apt-get install mysql-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:

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)

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.

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

Photos

Originally published at xameeramir.github.io.


Published by HackerNoon on 2017/12/25