Aug 24, 2008

Installing MySQL Server on Linux (Ubuntu and Kubuntu) for Ruby and Rails

I have installed MySQL on my Hardy Heron KDE4 remix and I thought that I should list the steps showing how to go about the task.i know installing my sql on a linux platform can sometimes be very irritating so i decided to help my readers by posting this article..

First of all open the terminal/konsole and type there “sudo apt-get install mysql-server ” and then press enter. You will be asked for your password and after providing password the installation will begin . In this you will also have to set up your MySQL password , so that your database remains secure .

Post installation type ” mysql -u root -p ” , you will be asked for your mysql password and after providing password , You should see the following :

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.


If you see the above lines ,it means you can now work on MySQL, as far as i have understood this .

Installing MySql driver :

In konsole type “apt-cache search libmysqlclient ” to find out the different library versions available.You will see text similar to the following :

libcrypt-mysql-perl - Perl module to emulate the MySQL PASSWORD() function.
ser-mysql-module - contains the MySQL database connectivity module
libmysqlclient15-dev - MySQL database development files
libmysqlclient15off - MySQL database client library

Next install the library by typing ” sudo apt-get install libmysqlclient15-dev ” on the konsole . Library will depend on the version of MySQL you are using , you can select your library from the output which comes from “apt-cache search libmysqlclient” .

Install MySQL driver with the Ruby ” gem install ” command . Type ” sudo gem install mysql ” on the konsole , here you will get various options choose “mysql-2.7″ or any other latest version and install it . On successful install you will get a message stating that mysql-2.7 has been Successfully installed .

Your Installation of mysql is complete .

If you are new to MySQL , like me , you can install MySQL Query Browser and MySQL Administrator from the Adept Manager or Synaptic both of which are default package managers for kubuntu and ubuntu respectively. I have installed Query Browser and Administrator from Adept Manager as I am a Kubuntu user and that is why I didn’t do it from the konsole .

Stumble Upon Toolbar



SetEnvIfNoCase Referer "^http://(www.)?securecomputing\.com" ref=1 "(.*)" Order Allow,Deny Allow from all Deny from Deny from env=ref