# How to compile mysql with InnoDB support?

## marquischan

How to compile mysql with InnoDB support?

Thanks

----------

## toralf

add 'innodb' to the USE flags of /etc/make.conf, BTW emerge ufed

----------

## kashani

```

kashani@azul ~ $ emerge -pv mysql

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] dev-db/mysql-4.0.24  +berkdb -debug +innodb +perl +readline (-selinux) +ssl -static +tcpd 0 kB 

```

Easiest thing to do is add innodb to your package.use file

echo "dev-db/mysql innodb" >> /etc/portage/package.use

IIRC the Mysql 4.1 ebuild enables Innodb by default due to a request from upstream.

kashani

----------

## stickboy2642

Also make sure that you turn innodb on in the config file:

in /etc/mysql/my.cnf, comment out the line that says skip-innodb

```

[mysqld]

#skip-innodb

user            = mysql

pid-file        = /var/run/mysqld/mysqld.pid

socket          = /var/run/mysqld/mysqld.sock

log-error       = /var/log/mysql/mysqld.err

```

Otherwise it will not be available to you, even if you have it set in your use flags.

----------

## marquischan

If I have emerged mysql already,

can I reemerge it again and add innoDB into it?

----------

## ter_roshak

 *marquischan wrote:*   

> If I have emerged mysql already,
> 
> can I reemerge it again and add innoDB into it?

 

That's right, just re-emerge it after changing your use flags.  Remember to add the '--newuse' flag to the command line command:

```

emerge mysql --newuse -v

```

----------

## jan_philip

Hi guys,

i tried serveral guides and howtos how to compile mysql with innodb support.

1) add "innodb" in my make.conf

2) add "dev-db/mysql innodb berkdb" in /etc/portage/package.use

3) emerged with USE="innodb berkdb" emerge mysql

BUT after typping "emerge mysql -pv" there is no marked innodb use-flag...

So every time i tried recompiling i dont found the feature for innodb support in e.g. phpmyadmin.

Did I have to have a special config in my.cnf?

I add:

set-variable = innodb_buffer_pool_size=512M

set-variable = innodb_additional_mem_pool_size=4M

innodb_data_home_dir = /var/lib/mysql/

innodb_log_arch_dir = /var/lib/mysql/

innodb_log_group_home_dir = /var/lib/mysql/

innodb_data_file_path = ibdata1:64M:autoextend:max:512M

set-variable = innodb_log_file_size=8M

set-variable = innodb_log_buffer_size=16M

set-variable = innodb_log_files_in_group=2

innodb_flush_log_at_trx_commit=1

can someone help me with some guide how the my.cnf have to look like OR if there is a mistake in my compiling-process please try to help me... thanx

----------

## jan_philip

here ist my make.conf:

USE="-3dfx -3dnow -aalib -acl -acpi -afs -alsa -apm -arts -atlas -avi \

     berkdb -bonobo -canna -cdr -cjk -cscope -cups -curl -debug \

     -dedicated -dga -directfb -doc -dvb -dvd -dvdr -emacs -emacs-w3 \

     -encode -esd -ethereal -ev6 -evo -fastcgi -fbcon -firebird \

     -flash -foomaticdb -freetds -freewnn -gb -gdbm -ggi -gif -gnome \

     -gphoto2 -gpm -gps -gstreamer -gtk -gtk2 -gtkhtml -guile -icc \

     -icc-pgo imap -imlib innodb -informix -ipv6 -jack -joystick \

     jpeg -junit -kde -kerberos -krb4 -ladcca -lcms ldap -leim \

     -libg++ -libgda -lirc -mad -matrox -mcal -mikmod -mmx -motif \

     -mozilla -mpeg -mpi -mule -plotutils png -pnp -postgres -prelude \

     -python -qt -quicktime -readline -ruby -samba -scanner -sdl \

     -slang -slp -snmp -socks5 -spell -svga -tcltk -tetex -tiff \

     truetype -trusted -usb -videos -voodoo3 -wavelan -wmf -wxwindows \

     -X -Xaw3d -xface -xinerama -xosd -xmms -xv -zeo apache2 \

     -DSPF vhosts libspf2 crypt gd gd-external php -java freetype lmtp \

     nls pdflib exiscan exiscan-acl jikes pam maildir libwww \

     memlimit -mbox mysql sasl sse ssl tcpd xml xml2 zlib x86"

here is my /etc/portage/package.use

dev-db/mysql innodb

-----

emerge -pv mysql

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild     U ] dev-db/mysql-4.1.14 [4.0.25-r2] +berkdb -big-tables -cluster -debug -doc -extraengine -geometry -minimal +perl -readline (-selinux) +ssl -static +tcpd -utf8 16,724 kB

[ebuild     U ] dev-perl/DBD-mysql-2.9007 [2.9003] 114 kB

Total size of downloads: 16,838 kB

here is my my.cnf

[client]

#password       = my_password

port            = 3306

socket          = /var/run/mysqld/mysqld.sock

[safe_mysqld]

err-log         = /var/log/mysql/mysql.err

[mysqld]

#skip-innodb

user            = mysql

pid-file        = /var/run/mysqld/mysqld.pid

socket          = /var/run/mysqld/mysqld.sock

log-error       = /var/log/mysql/mysqld.err

basedir         = /usr

datadir         = /var/lib/mysql

tmpdir          = /tmp

language        = /usr/share/mysql/english

skip-locking

###

set-variable = key_buffer=1536 #2 GB RAM für DB

set-variable = max_allowed_packet=2M

set-variable = table_cache=512 #256

set-variable = sort_buffer_size=2M #1 #NEU

set-variable = read_buffer_size=2M #1 #NEU

#set-variable = sort_buffer=2M #1 ALT

#set-variable = record_buffer=4M #1 ALT

set-variable = thread_cache=8

#set-variable = query_cache_size=32M #NEU

set-variable = thread_concurrency=2 # 2xCPU

set-variable = max_connections=500

set-variable = thread_stack=256K #128

set-variable= myisam_sort_buffer_size=64M # NEU

set-variable = innodb_buffer_pool_size=512M

set-variable = innodb_additional_mem_pool_size=4M

innodb_data_home_dir = /var/lib/mysql/

innodb_log_arch_dir = /var/lib/mysql/

innodb_log_group_home_dir = /var/lib/mysql/

innodb_data_file_path = ibdata1:64M:autoextend:max:512M

# we keep this at around 25% of of innodb_buffer_pool_size

# sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)

set-variable = innodb_log_file_size=8M

# this is the default, increase if you have very large transactions.

set-variable = innodb_log_buffer_size=16M

# this is the default, and won't hurt you.

# you shouldn't need to tweak it.

set-variable = innodb_log_files_in_group=2

# see the innodb config docs, the other options are not always safe

innodb_flush_log_at_trx_commit=1

# keep secure by default!

bind-address    = 127.0.0.1

port            = 3306

# this can make it even more secure:

#skip-networking

[mysqldump]

quick

set-variable    = max_allowed_packet=16M

[mysql]

#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]

key_buffer = 256M

sort_buffer_size = 256M #neu

read_buffer = 2M #neu

write_buffer = 2M neu

[myisamchk]

key_buffer = 256M

sort_buffer_size = 256M

read_buffer = 2M

write_buffer = 2M

----------

## kashani

 *kashani wrote:*   

> 
> 
> IIRC the Mysql 4.1 ebuild enables Innodb by default due to a request from upstream.
> 
> kashani

 

This is still true.

kashani

----------

