Difference between revisions of "MySQL"

From CBLFS
Jump to navigationJump to search
Line 15: Line 15:
 
* [[TCP Wrappers]]
 
* [[TCP Wrappers]]
  
{{ Note|If you want Berkley db DO NOT USE THE EXTERNAL VERSION PROVIDED BY CBLFS.  It will fail.  Instead just pass --with-berkley-db.  The version provided with sql is version 4.1.24.}}
+
{{Note|--with-berkely-db will instruct the build system to use the internal version of [[Berkely DB]] (Version 4.1.24). This is highly recommended as building against the an external installation rarely compiles cleanly.}}
  
 
== MySQL User/Group ==
 
== MySQL User/Group ==
Line 39: Line 39:
 
  --without-readline \
 
  --without-readline \
 
  --with-extra-charsets=all \
 
  --with-extra-charsets=all \
  --with-embedded-server &&
+
  --with-embedded-server \
 +
--with-berkley-db &&
 
  make testdir=/tmp/mysql
 
  make testdir=/tmp/mysql
  
Line 70: Line 71:
 
  --without-readline \
 
  --without-readline \
 
  --with-extra-charsets=all \
 
  --with-extra-charsets=all \
  --with-embedded-server &&
+
  --with-embedded-server \
 +
--with-berkley-db &&
 
  make testdir=/tmp/mysql
 
  make testdir=/tmp/mysql
  
Line 99: Line 101:
 
  --without-readline \
 
  --without-readline \
 
  --with-extra-charsets=all \
 
  --with-extra-charsets=all \
  --with-embedded-server &&
+
  --with-embedded-server \
 +
--with-berkley-db &&
 
  make testdir=/tmp/mysql
 
  make testdir=/tmp/mysql
  
Line 128: Line 131:
 
  --without-readline \
 
  --without-readline \
 
  --with-extra-charsets=all \
 
  --with-extra-charsets=all \
  --with-embedded-server &&
+
  --with-embedded-server \
 +
--with-berkley-db &&
 
  make testdir=/tmp/mysql
 
  make testdir=/tmp/mysql
  

Revision as of 15:55, 25 February 2008

Download Source: ftp://ftp.osuosl.org/pub/mysql/Downloads/MySQL-5.0/mysql-5.1.43.tar.gz

Introduction to MySQL

MySQL is a widely used and fast SQL database server. It is a client/server implementation that consists of a server daemon and many different client programs and libraries.

Project Homepage: http://www.mysql.com/

Dependencies

Optional

Caution.png

Note

--with-berkely-db will instruct the build system to use the internal version of Berkely DB (Version 4.1.24). This is highly recommended as building against the an external installation rarely compiles cleanly.

MySQL User/Group

groupadd -g 40 mysql &&
useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false -u 40 mysql

Non-Multilib

Compile the package:

C_EXTRA_FLAGS=-fno-strict-aliasing \
./configure --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/srv/mysql \
--enable-thread-safe-client \
--enable-assembler \
--enable-local-infile \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--without-debug \
--without-bench \
--without-readline \
--with-extra-charsets=all \
--with-embedded-server \
--with-berkley-db &&
make testdir=/tmp/mysql


Install the package

make testdir=/tmp/mysql install &&
rm -rf /tmp/mysql &&
cd /usr/lib &&
ln -v -sf mysql/libmysqlclient{,_r}.so* .

Multilib

32Bit

Compile the package:

CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" \
LDFLAGS="-L/usr/lib" C_EXTRA_FLAGS=-fno-strict-aliasing \
./configure --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/srv/mysql \
--enable-thread-safe-client \
--enable-assembler \
--enable-local-infile \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--without-debug \
--without-bench \
--without-readline \
--with-extra-charsets=all \
--with-embedded-server \
--with-berkley-db &&
make testdir=/tmp/mysql

Install the package

make testdir=/tmp/mysql install &&
mv -v /usr/bin/mysql_config{,-32} &&
rm -rf /tmp/mysql &&
cd /usr/lib &&
ln -v -sf mysql/libmysqlclient{,_r}.so* .

N32

Compile the package

CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" \
C_EXTRA_FLAGS=-fno-strict-aliasing \
./configure --prefix=/usr --libdir=/usr/lib32 \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/srv/mysql \
--enable-thread-safe-client \
--enable-assembler \
--enable-local-infile \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--without-debug \
--without-bench \
--without-readline \
--with-extra-charsets=all \
--with-embedded-server \
--with-berkley-db &&
make testdir=/tmp/mysql

Install the package

make testdir=/tmp/mysql install &&
mv -v /usr/bin/mysql_config{,-n32} &&
rm -rf /tmp/mysql &&
cd /usr/lib32 &&
ln -v -sf mysql/libmysqlclient{,_r}.so* .

64Bit

Compile the package

CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" \
C_EXTRA_FLAGS=-fno-strict-aliasing \
./configure --prefix=/usr --libdir=/usr/lib64 \
--sysconfdir=/etc \
--libexecdir=/usr/sbin \
--localstatedir=/srv/mysql \
--enable-thread-safe-client \
--enable-assembler \
--enable-local-infile \
--with-unix-socket-path=/var/run/mysql/mysql.sock \
--without-debug \
--without-bench \
--without-readline \
--with-extra-charsets=all \
--with-embedded-server \
--with-berkley-db &&
make testdir=/tmp/mysql

Install the package

make testdir=/tmp/mysql install &&
mv -v /usr/bin/mysql_config{,-64} &&
ln -sfv multiarch_wrapper /usr/bin/mysql_config &&
rm -rf /tmp/mysql &&
cd /usr/lib64 &&
ln -v -sf mysql/libmysqlclient{,_r}.so* .

Configuring

install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf
mysql_install_db --user=mysql &&
chgrp -v mysql /srv/mysql{,/test,/mysql}
install -v -m755 -o mysql -g mysql -d /var/run/mysql &&
mysqld_safe --user=mysql 2>&1 >/dev/null &
mysqladmin -u root password '<new-password>'
mysqladmin -p shutdown

BootScript

Install the init script included in the bootscripts package:

make install-mysql

Contents

Installed Directories: /usr/include/mysql, /usr/share/mysql, /usr/lib/mysql
Installed Programs: mysqld_safe, mysql_install_db, msql2mysql, mysql_config, mysql_fix_privilege_tables, mysql_fix_extensions, mysql_setpermission, mysql_secure_installation, mysql_zap, mysqlaccess, mysqlbug, mysql_convert_table_format, mysql_find_rows, mysqlhotcopy, mysqldumpslow, mysql_explain_log, mysql_tableinfo, mysql_upgrade_shell, mysqld_multi, replace, comp_err, perror, resolveip, my_print_defaults, resolve_stack_dump, mysql_waitpid, innochecksum, myisamchk, myisamlog, myisampack, myisam_ftdump, mysql_tzinfo_to_sql, mysqld, mysql, mysqladmin, mysqlcheck, mysqlshow, mysqldump, mysqlimport, mysqltest, mysqlbinlog, mysql_upgrade, mysqltestmanagerc, mysqltestmanager-pwgen, mysql_client_test, mysqltest_embedded, mysqltestmanager, mysqlmanager
Installed Libraries: libmystrings.a, libmysys.a, libdbug.a, libmyisam.a, libmyisammrg.a, libheap.a, libvio.a, libmysqlclient_r.{a,la,so}, libmysqlclient.{a,la,so}, libmysqld.a
Retrieved from "?title=MySQL&oldid=13359"