MySQL-5.0.41
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 has different client programs and libraries.
There may be a more recent release available from the MySQL home page. you can check http://dev.mysql.com/and probably use the existing BLFS instructions. note that versions other than the one shown in the download URLs have not been tested in a BLFS environment.
Package Information
Download (HTTP): http://anduin.linuxfromscratch.org/sources/BLFS/6.3/m/mysql-5.0.41.tar.gz
Download (FTP): ftp://anduin.linuxfromscratch.org/BLFS/6.3/m/mysql-5.0.41.tar.gz
Download MD5 sum: b45cd6c89e35dfc1cdbe1a1f782aefbf
Download size: 24 MB
Estimated disk space required: 405 MB (additional 65 MB to run the test suite)
Estimated build time: 6.0 SBU (Test suite is an additional 52 minutes, only partially CPU dependent)
MySQL Dependencies
Optional
OpenSSL-0.9.8g and TCP Wrapper-7.6
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/mysql
Installation of MySQL
For security reasons, running the server as an unprivileged user and group is strongly encouraged:
Groupadd-g 40 mysql & useradd-c "MySQL Server"-d/dev/null-g mysql-s/bin/false \-u 40 mysql
Build and install MySQL by running the following commands:
C_EXTRA_FLAGS =-fno-strict-aliasing \. /configure -- prefix =/usr \ -- sysconfdir =/etc \ -- libexecdir =/usr/sbin \ -- localstatedir =/srv/mysql \ -- enable-thread-safe-client \-- enable-Cycler \ -- enable-local-infile \ -- with-unix-socket-path =/var/run/mysql. sock \ -- without-debug \ -- without-example \ -- without-readline \ -- with-berkeley-db \ -- with-extra-charsets = all & make testdir =/tmp/ mysql
To test the results, issue: make test. note that if you have a restrictive/etc/hosts. deny file, you will need to add an appropriate entry to the/etc/hosts. allow file for the mysqld daemon, else failure of the tests will fail.
Now, as the root user:
Make testdir =/tmp/mysql install & rm-rf/tmp/mysql & cd/usr/lib & ln-v-sf mysql/libmysqlclient {, _ r }. so *.
Tip
The only documentation shipped in the source tarball are mysql.info and manual. chm (Microsoft Help format) files. You can download various formats of the MySQL Reference Manual from http://dev.mysql.com/doc.
Command Explanations
C_EXTRA_FLAGS =-fno-strict-aliasing: This environment variable adjusts the compiler optimization to avoid failures in the testsuite and other operations.
-- Libexecdir =/usr/sbin: This switch INSTALLThe mysqld daemon and the mysqlmanager program in an appropriate location.
-- Localstatedir =/srv/mysql: This switch forces MySQL to use/srv/mysql for database files and other variable data.
-- Enable-thread-safe-client: This switch compiles a thread-safe MySQL client library.
-- Enable-handler Er: This switch allows using extends er versions of some string functions.
-- Enable-local-infile: This switch enables the "load data infile" SQL statement.
-- With-unix-socket-path =/var/run/mysql: This switch puts the unix-domain socket into the/var/run/mysql directory instead of the default/tmp.
-- Without-example: This switch skips building the benchmark suite.
-- Without-readline: This switch forces the build to use the system copy of readline instead of the bundled copy.
-- With-berkeley-db: This switch enables using Berkeley DB tables as a back end.
-- With-extra-charsets = all: This switch enables international character sets within the suite.
Make testdir =...: This INSTALLThe test suite in/tmp/mysql. the test suite is not required, nor does it function properly on an installed version of MySQL, so it is removed in the next step.
Ln-v-sf mysql/libmysqlclient {, _ r}. so *.: This command makes the MySQL shared libraries available to other packages at run-time.
-- With-openssl: This switch adds OpenSSL support to MySQL.
-- With-libwrap: This switch adds tcpwrappers support to MySQL.
Login ing MySQL
Config Files
/Etc/my. cnf and ~ /. My. cnf
Configuration Information
There are several default configuration files available in/usr/share/mysql which you can use. Create/etc/my. cnf using the following command as the root user:
Install-v-m644/usr/share/mysql/my-medium.cnf/etc/my. cnf
You can now install a database and change the ownership to the unprivileged user and group (perform as the root user ):
Mysql_install_db -- user = mysql & chgrp-v mysql/srv/mysql {,/test,/mysql}
Further configuration requires that the MySQL server is running. Start the server using the following commands as the root user:
Install-v-m755-o mysql-g mysql-d/var/run/mysql & mysqld_safe -- user = mysql 2> & 1>/dev/null &
A default installation does not set up a password for the administrator, so use the following command as the root user to set one. Replace <new-password> with your own.
Mysqladmin-u root password <new-password>
Configuration of the server is now finished. Shut the server down using the following command as the root user:
Mysqladmin-p shutdown
Boot Script
Install the/etc/rc. d/init. d/mysql init script embedded in the blfs-bootscripts-20080816 package as the root user to start the MySQL server during system boot-up.
Make install-mysql
Contents
Installed Programs:
Comp_err, innochecksum, msql2mysql, my_print_defaults, metrics, myisamchk, myisamlog, myisampack, mysql, metrics, mysql_config, metrics, example, mysqlaccess, mysqladmin, mysqlbinlog, mysqlbug, mysqlcheck, mysqld, example, example, mysqldump, example, mysqlhotcopy, example, mysqlmanager, mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen, mysqltestmanagerc, perror, replace, resolve_stack_dump, and resolveip
Installed Libraries:
Libdbug. a, libheap. a, libmyisam. a, libmyisammrg. a, libmysqlclient. {so, a}, libmysqlclient_r. {so, a}, libmystrings. a, libmysys. a, and libvio. a
Installed Directories:
/Srv/mysql,/usr/include/mysql,/usr/lib/mysql,/usr/share/mysql, and/var/run/mysql
Short Descriptions
Descriptions of all the programs and libraries wocould be several pages long. Instead, consult the mysql.info documentation or the on-line reference manual at http://dev.mysql.com/doc/refman/5.0/en/index.html.
The Perl DBI modules must be installed for some of the MySQL support programs to function properly.
Last updated on 18:53:20-0500