%general-entities; ]> $LastChangedBy$ $Date$ MySQL-&mysql-version; MySQL 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. There may be a more recent release available from the MySQL home page. You can check 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. &lfs70_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &mysql-md5sum; Download size: &mysql-size; Estimated disk space required: &mysql-buildsize; Estimated build time: &mysql-time; Additional Downloads Optional patch: Optional Documentation (see tip below): The patch is required only if you plan to install Amarok. MySQL Dependencies Required Recommended Optional and libaio User Notes: 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 There are a great many options available to cmake. Check the output of the `cmake . -LH` for additional customization options. See ithe MySQL Documentation for a full listing of all options. If you plan to install Amarok, you need to apply the optional patch, add the cmake option -DWITH_EMBEDDED_SERVER=ON and add Embedded to the SEGMENTS variable below. Apply the optional patch: patch -Np1 -i ../mysql-&mysql-version;-embedded-library-shared-1.patch Build and install MySQL by running the following commands: cmake . \ -DSYSCONFDIR=/etc \ -DMYSQL_DATADIR=/srv/mysql \ -DINSTALL_MYSQLDATADIR=/srv/mysql \ -DCMAKE_INSTALL_PREFIX=/usr \ -DINSTALL_BINDIR=bin \ -DINSTALL_SBINDIR=sbin \ -DINSTALL_DOCDIR=share/doc/mysql \ -DINSTALL_DOCREADMEDIR=share/doc/mysql \ -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_INFODIR=share/info \ -DINSTALL_LIBDIR=lib \ -DINSTALL_MANDIR=share/man \ -DINSTALL_MYSQLSHAREDIR=share/mysql \ -DINSTALL_MYSQLTESTDIR=share/mysql-test \ -DINSTALL_PLUGINDIR=lib/plugin \ -DINSTALL_SCRIPTDIR=bin \ -DINSTALL_SHAREDIR=share/mysql \ -DINSTALL_SQLBENCHDIR=share/mysql-bench \ -DINSTALL_SUPPORTFILESDIR=share/mysql/support-files \ -DWITH_ZLIB=system \ -DWITH_SSL=system \ -DWITH_READLINE=system \ -DMYSQL_UNIX_ADDR=/var/run/mysql/mysql.sock \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_FEDERATED_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DMYSQL_MAINTAINER_MODE=OFF \ -DWITH_DEBUG=OFF && make To test the results, issue: make test-force 2>&1 | tee test.log. This forces the test to run to completion and logs all the test output. There will be many tests that are not run due to configuration options and developer considerations. Note that if you use TCP Wrappers and 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. Otherwise many of the tests will fail. The ssl tests may fail due to expired certifictes. Now, as the root user: SEGMENTS="Client Server IniFiles ManPages SharedLibraries" SEGMENTS="$SEGMENTS Development Documentation Info Readme" for segment in $SEGMENTS; do cmake -DCMAKE_INSTALL_COMPONENT=$segment -P cmake_install.cmake done unset SEGMENTS The only documentation shipped in the source tarball are mysql.info and man pages. You can download various formats of the MySQL Reference Manual from . If you only want to build and install the mysql client, use: cmake . && make mysqlclient libmysql Continue as root: make install Command Explanations cmake -DCMAKE_INSTALL_COMPONENT=$segment ...: This command installs the appropriate portion of the package. Different segemnts may be added or deleted as desired. Valid segments are listed with `make list_install_components`. Note that the 'DataFiles' install segment does not honor the -DMYSQL_DATADIR or -DINSTALL_MYSQLDATADIR statements. Configuring MySQL Config Files /etc/my.cnf and ~/.my.cnf ~/.my.cnf /etc/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/support-files/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 --basedir=/usr --datadir=/srv/mysql --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 included in the package as the root user to start the MySQL server during system boot-up. mysql make install-mysql Contents Installed Programs Installed Libraries Installed Directories comp_err, innochecksum, msql2mysql, my_print_defaults, myisam_ftdump, myisamchk, myisamlog, myisampack, mysql, mysql_client_test, mysql_config, mysql_convert_table_format, mysql_create_system_tables, mysql_explain_log, mysql_find_rows, mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db, mysql_secure_installation, mysql_setpermission, mysql_tableinfo, mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin, mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe, mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager, mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen, mysqltestmanagerc, perror, replace, resolve_stack_dump, and resolveip libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a, libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a, libmysys.a, and libvio.a /srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql, and /var/run/mysql Short Descriptions Descriptions of all the programs and libraries would be several pages long. Instead, consult the mysql.info documentation or the on-line reference manual at . The Perl DBI modules must be installed for some of the MySQL support programs to function properly.