web of unni

About | GuestBook | Add WebOfUnni to Google ToolBar

Download Day

April 28, 2008

Installing Mysql from source in Ubuntu

Filed under: error, installation, mysql, ubuntu — unni @ 9:47 am

I was doing a newsletter project for my company for that i need a Web server with PHP/Mysql support, so i selected lighttpd with PHP/Mysql. I got stuck at several points while installing Mysql. I am posting the error that i encountered while installing Mysql in my ubuntu machine.

I used the Mysql source for Database installation. Downloaded the source file from :

http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51b.tar.gz/from/http://mysql.mirror.rafal.ca/

Then configured with following command :

./configure –prefix=/usr/unni/mysql5 –with-unix-socket-path=/tmp/mysql.sock

But it ended with an error :

checking for termcap functions library… configure: error: No curses/termcap library found

Google gave me a solution at :

http://darpanetwork.blogspot.com/2008/02/compiling-mysql-on-ubuntu-linux.html

So i installed libncurses5-dev and fixed that error :

#apt-get install libncurses5-dev

Then configuration went successfully, but the make command gave another error :

====================================
g++ -DDEFAULT_BASEDIR=\”/usr/unni/mysql5\” -DDATADIR=”\”/usr/unni/mysql5/var\”" -DDEFAULT_CHARSET_HOME=”\”/usr/unni/mysql5\”" -DSHAREDIR=”\”/usr/unni/mysql5/share/mysql\”" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR=”\”/usr/unni/mysql5/etc\”" -DHAVE_CONFIG_H -I. -I. -I../include -I../include -I../include -I. -O -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o my_new.cc
../depcomp: line 512: exec: g++: not found
make[2]: *** [my_new.o] Error 127
make[2]: Leaving directory `/usr/unni/mysql-5.0.51/mysys’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/unni/mysql-5.0.51′
make: *** [all] Error 2

==============================================

This time i figured out the error as the absence of basic compilers, so i installed Ubuntu build-essential, that fixed that error.

# apt-get install build-essential

But i got another error from make command :

==============================================

g++ -DDEFAULT_BASEDIR=\”/usr/unni/mysql5\” -DDATADIR=”\”/usr/unni/mysql5/var\”" -DDEFAULT_CHARSET_HOME=”\”/usr/unni/mysql5\”" -DSHAREDIR=”\”/usr/unni/mysql5/share/mysql\”" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR=”\”/usr/unni/mysql5/etc\”" -DHAVE_CONFIG_H -I. -I. -I../include -I../include -I../include -I. -O -DDBUG_OFF -fno-implicit-templates -fno-exceptions -fno-rtti -c -o my_new.o my_new.cc
../include/my_global.h:987: error: redeclaration of C++ built-in type ‘bool’
make[2]: *** [my_new.o] Error 1
make[2]: Leaving directory `/usr/unni/mysql-5.0.51/mysys’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/unni/mysql-5.0.51′
make: *** [all] Error 2

===================================================

Mysql forum gave me the solution :

This happened because, first the make command used the native C compiler since there was no g++ compiler ( configuration command set the compiler as gcc, because that was the available compiler ). After that i installed the g++ compiler so the next make used the g++ to compile the C code as C++ .

Solution :

Run the configuration command again followed by make :

1. ./configure –prefix=/usr/unni/mysql5 –with-unix-socket-path=/tmp/mysql.sock

2. make

3. make install

Thats done :-)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Created and maintained by Unnikrishnan
Hosted by Host cats