MYSQL5FromSource

Differences between revisions 5 and 6
Revision 5 as of 2005-11-23 02:57:50
Size: 3641
Editor: 200
Comment: added users, grant tables my.conf and some other infos
Revision 6 as of 2005-11-23 03:30:01
Size: 3749
Editor: 200
Comment: changed variables for generic build
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
... but I'm sure about witch ones. ... but I'm not sure about witch ones.
Line 57: Line 57:
export CFLAGS="-O3 -mpentiumpro" export CHOST="i686-pc-linux-gnu"
export CFLAGS="-mcpu=i686 -march=i686 -O3 -pipe -fomit-frame-pointer"
Line 59: Line 60:
export CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti"
Line 61: Line 61:

{{{-fomit-frame-pointer}}} should be omitted if you intend to debug. Otherwise leave it as it make mysql faster.

Please discuss in [http://www.ubuntuforums.org/showthread.php?t=93725&page=1&pp=10 this thread on ubuntu forums].

Tested in Breezy.

Prerequisites

You must download MYSQL5 (of course ;)

wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.16.tar.gz/from/http://mysql.localhost.net.ar/
tar xzvf mysql-5.0.16.tar.gz
cd mysql-5.0.16/

You must install packages :

sudo apt-get install make build-essential

You need development libraries

... but I'm not sure about witch ones.

You need to create the user and group

sudo groupadd mysql
sudo useradd -g mysql mysql

Compilation optimisation

You can speed up Mysql with processor optimisation

If you have a different processor, change the CHOST, CFLAGS, CXXFLAGS.

If you don't know what it is, Take the Generic one!

attachment:IconsPage/IconWarning3.png The configuration for specific processors were not tested. If it compiles you're fine. If it doesn't try the generic one.Use only one of the following three

  • Athlon-tbird XP (AMD)

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -msse -mmmx  -mfpmath=sse"
export CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -msse -mmmx  -mfpmath=sse -felide-constructors -fno-exceptions -fno-rtti"
export CXX=gcc 
  • Pentium 4 (Intel)

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -msse -mmmx  -mfpmath=sse"
export CXXFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -msse -mmmx  -mfpmath=sse -felide-constructors -fno-exceptions -fno-rtti"
export CXX=gcc 
  • Generic

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-mcpu=i686 -march=i686 -O3 -pipe -fomit-frame-pointer"
export CXX=gcc 

-fomit-frame-pointer should be omitted if you intend to debug. Otherwise leave it as it make mysql faster.

Configuration

This is a full configuration.

Do it in the MYSQL5 folder.

You can add/delete some of the options if you don't need it. This is intended to be a default mysql5 installation, again I'm not sure about this.

./configure \
--prefix=/usr/local/mysql \
--with-mysqld-user=mysql \
--without-debug \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--disable-shared \
--localstatedir=/usr/local/mysql/data \
--with-extra-charsets=none \
--enable-assembler \
--with-unix-socket-path=/tmp/mysql.socket

make
sudo make install

This will install mysql in /usr/local/mysql and data in /usr/local/mysql/data.

my.conf

Now create the conf based in any of the pre-build confs. For small servers I recomend my-medium.cnf

sudo cp support-files/my-medium.cnf /etc/my.cnf

You should edit this file for your needs.

Create GRANT tables

You must create the GRANT tables, and there is a very easy way to do so.

sudo /usr/local/mysql/bin/mysql_install_db --user=mysql

Changing Owners

sudo chown -R root  /usr/local/mysql
sudo chown -R mysql /usr/local/mysql/var
sudo chgrp -R mysql /usr/local/mysql

Testing

/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysql

You should add /usr/local/path/bin to your path so you can always use mysql, mysqldump, mysqladmin and some others right from the shell.

Starting Mysql at boot time

sudo cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
sudo update-rc.d mysql defaults

When you restart mysql should be up if everything went ok.

CategoryDocumentation CategoryCleanup

MYSQL5FromSource (last edited 2008-08-06 16:24:23 by localhost)