mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-26 08:42:12 +08:00
b384470b9f
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8679 af4574ff-66df-0310-9fd7-8a98e5e911e0
354 lines
14 KiB
XML
354 lines
14 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!-- <!ENTITY mysql-download-http "http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz">
|
|
<!ENTITY mysql-download-ftp "ftp://ftp.fu-berlin.de/unix/databases/mysql/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz"> -->
|
|
<!ENTITY mysql-download-http "&sources-anduin-http;/m/mysql-&mysql-version;.tar.gz">
|
|
<!ENTITY mysql-download-ftp "&sources-anduin-ftp;/m/mysql-&mysql-version;.tar.gz">
|
|
<!ENTITY mysql-md5sum "a90d87a71fa3c23dff6d78afc8e3184c">
|
|
<!ENTITY mysql-size "23 MB">
|
|
<!ENTITY mysql-buildsize "492 MB (additional 250 MB to run the test suite)">
|
|
<!ENTITY mysql-time "4.7 SBU (Test suite is an additional 61 minutes, only partially CPU dependent)">
|
|
]>
|
|
|
|
<sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
|
|
<?dbhtml filename="mysql.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>MySQL-&mysql-version;</title>
|
|
|
|
<indexterm zone="mysql">
|
|
<primary sortas="a-MySQL">MySQL</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to MySQL</title>
|
|
|
|
<para><application>MySQL</application> 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.</para>
|
|
|
|
<para>There may be a more recent release available from the
|
|
<application>MySQL</application> home page. You can check
|
|
<ulink url="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.</para>
|
|
|
|
<para>&lfssvn_checked;20100806&lfssvn_checked2;</para>
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>Download (HTTP): <ulink url="&mysql-download-http;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download MD5 sum: &mysql-md5sum;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download size: &mysql-size;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated disk space required: &mysql-buildsize;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated build time: &mysql-time;</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">Additional Download</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>Required Patch:
|
|
<ulink url="&patch-root;/mysql-&mysql-version;-makefile-1.patch"/>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Recommended</bridgehead>
|
|
<para role="optional"><xref linkend="openssl"/></para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional"><xref linkend="tcpwrappers"/></para>
|
|
|
|
<!-- Removing libedit because it causes more problems than it solves.
|
|
|
|
<ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
|
|
(as an alternative to readline)-->
|
|
|
|
<para condition="html" role="usernotes">User Notes:
|
|
<ulink url="&blfs-wiki;/mysql"/></para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of MySQL</title>
|
|
|
|
<para>For security reasons, running the server as an unprivileged user
|
|
and group is strongly encouraged:</para>
|
|
|
|
<screen role="root"><userinput>groupadd -g 40 mysql &&
|
|
useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false \
|
|
-u 40 mysql</userinput></screen>
|
|
|
|
<note><para>There are a great many options available to
|
|
<userinput>./configure</userinput>. Check the output of the
|
|
<option>--help</option> option for additional customization
|
|
options.</para></note>
|
|
|
|
<para>Build and install <application>MySQL</application> by
|
|
running the following commands:</para>
|
|
|
|
<screen><userinput>patch -Np1 -i ../mysql-&mysql-version;-makefile-1.patch &&
|
|
CFLAGS="-O3" \
|
|
CXX=gcc \
|
|
CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
|
|
./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-readline \
|
|
--with-plugins=innobase,myisam \
|
|
--with-extra-charsets=all \
|
|
--with-ssl &&
|
|
make</userinput></screen>
|
|
|
|
<para>To test the results, issue: <command>make test-force 2>&1 | tee
|
|
test.log</command>. 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 <filename>/etc/hosts.deny</filename>
|
|
file, you will need to add an appropriate entry to the
|
|
<filename>/etc/hosts.allow</filename> file for the
|
|
<command>mysqld</command> daemon. Otherwise many of the tests will
|
|
fail.</para>
|
|
|
|
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
|
|
|
<screen role="root"><userinput>make benchdir_root=/tmp/mysql-bench install &&
|
|
rm -rf /tmp/mysql &&
|
|
pushd /usr/lib &&
|
|
ln -v -sf mysql/libmysqlclient{,_r}.so* . &&
|
|
popd &&
|
|
|
|
pushd /usr/share/info &&
|
|
rm -v dir &&
|
|
for FILENAME in *; do
|
|
install-info $FILENAME dir 2>/dev/null
|
|
done &&
|
|
popd</userinput></screen>
|
|
|
|
<tip>
|
|
<para>The only documentation shipped in the source tarball are
|
|
<filename>mysql.info</filename> and man pages. You can download various
|
|
formats of the <application>MySQL</application> Reference Manual
|
|
from <ulink url="http://dev.mysql.com/doc/"/>.</para>
|
|
</tip>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para><parameter>CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors
|
|
-fno-exceptions -fno-rtti"</parameter>: These optimizations are recommended
|
|
by the developers.</para>
|
|
|
|
<para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs
|
|
the <command>mysqld</command> daemon and the
|
|
<command>mysqlmanager</command> program in an appropriate location.</para>
|
|
|
|
<para><parameter>--localstatedir=/srv/mysql</parameter>: This switch
|
|
forces <application>MySQL</application> to use
|
|
<filename class='directory'>/srv/mysql</filename> for database files and
|
|
other variable data.</para>
|
|
|
|
<para><parameter>--enable-thread-safe-client</parameter>: This
|
|
switch compiles a thread-safe <application>MySQL</application> client
|
|
library.</para>
|
|
|
|
<para><parameter>--enable-assembler</parameter>: This switch allows using
|
|
assembler versions of some string functions.</para>
|
|
|
|
<para><parameter>--enable-local-infile</parameter>: This switch enables
|
|
the <quote>LOAD DATA INFILE</quote> SQL statement.</para>
|
|
|
|
<para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
|
|
This switch puts the unix-domain socket into the
|
|
<filename class="directory">/var/run/mysql</filename> directory instead of
|
|
the default <filename class="directory">/tmp</filename>.</para>
|
|
|
|
<para><parameter>--without-readline</parameter>: This switch forces the
|
|
build to use the system copy of <application>readline</application> instead
|
|
of the bundled copy.</para>
|
|
|
|
<para><parameter>--with-extra-charsets=all</parameter>: This switch enables
|
|
international character sets within the suite.</para>
|
|
|
|
<para><parameter>--with-plugins=innobase,myisam</parameter>: This switch enables
|
|
two useful table types. Check <command>./configure --help</command> for
|
|
other table types.</para>
|
|
|
|
<para><parameter>--with-ssl</parameter>: This switch enables encrypted
|
|
communication between client and server.</para>
|
|
|
|
<para><command>make benchdir_root=...</command>: This installs the benchmark
|
|
and test suites in a non-system location.</para>
|
|
|
|
<para><command>ln -v -sf mysql/libmysqlclient{,_r}.so* .</command>: This
|
|
command makes the <application>MySQL</application> shared libraries
|
|
available to other packages at run-time.</para>
|
|
|
|
<para><option>--with-openssl</option>: This switch adds OpenSSL support
|
|
to <application>MySQL</application>.</para>
|
|
|
|
<para><option>--with-libwrap</option>: This switch adds tcpwrappers
|
|
support to <application>MySQL</application>.</para>
|
|
|
|
<para><command>pushd ... popd</command>: This set of commands rebuilds the
|
|
<filename>/usr/share/info/dir</filename> file as the installation failed
|
|
to do so.</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring MySQL</title>
|
|
|
|
<sect3 id="mysql-config">
|
|
<title>Config Files</title>
|
|
|
|
<para><filename>/etc/my.cnf</filename> and
|
|
<filename>~/.my.cnf</filename></para>
|
|
|
|
<indexterm zone="mysql mysql-config">
|
|
<primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
|
|
</indexterm>
|
|
|
|
<indexterm zone="mysql mysql-config">
|
|
<primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
|
|
</indexterm>
|
|
|
|
</sect3>
|
|
|
|
<sect3>
|
|
<title>Configuration Information</title>
|
|
|
|
<para>There are several default configuration files available in
|
|
<filename class="directory">/usr/share/mysql</filename> which you can
|
|
use. Create <filename>/etc/my.cnf</filename> using the following command
|
|
as the <systemitem class="username">root</systemitem> user:</para>
|
|
|
|
<screen role="root"><userinput>install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf
|
|
sed -i -e s/^skip-federated/#skip-federated/ /etc/my.cnf</userinput></screen>
|
|
|
|
<para>The change to <filename>/etc/my.cnf</filename> can be omitted if the
|
|
option <option>--with-plugins=federated</option> is used.</para>
|
|
|
|
<para>You can now install a database and change the ownership to the
|
|
unprivileged user and group (perform as the <systemitem
|
|
class="username">root</systemitem> user):</para>
|
|
|
|
<screen role="root"><userinput>mysql_install_db --user=mysql &&
|
|
chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
|
|
|
|
<para>Further configuration requires that the
|
|
<application>MySQL</application> server is running. Start
|
|
the server using the following commands as the <systemitem
|
|
class="username">root</systemitem> user:</para>
|
|
|
|
<screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &&
|
|
mysqld_safe --user=mysql 2>&1 >/dev/null &</userinput></screen>
|
|
|
|
<para>A default installation does not set up a password for the
|
|
administrator, so use the following command as the <systemitem
|
|
class="username">root</systemitem> user to set one. Replace
|
|
<replaceable><new-password></replaceable> with your own.</para>
|
|
|
|
<screen role="root"><userinput>mysqladmin -u root password <replaceable><new-password></replaceable></userinput></screen>
|
|
|
|
<para>Configuration of the server is now finished. Shut the server
|
|
down using the following command as the <systemitem
|
|
class="username">root</systemitem> user:</para>
|
|
|
|
<screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="mysql-init">
|
|
<title>Boot Script</title>
|
|
|
|
<para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
|
|
included in the <xref linkend="bootscripts"/> package as
|
|
the <systemitem class="username">root</systemitem> user to start the
|
|
<application>MySQL</application> server during system boot-up.</para>
|
|
|
|
<indexterm zone="mysql mysql-init">
|
|
<primary sortas="f-mysql">mysql</primary>
|
|
</indexterm>
|
|
|
|
<screen role="root"><userinput>make install-mysql</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>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</seg>
|
|
<seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
|
|
libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
|
|
libmysys.a, and libvio.a</seg>
|
|
<seg>/srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql, and
|
|
/var/run/mysql</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<para>Descriptions of all the programs and libraries would be several
|
|
pages long. Instead, consult the <filename>mysql.info</filename>
|
|
documentation or the on-line reference manual at <ulink
|
|
url="http://dev.mysql.com/doc/refman/5.0/en/index.html"/>.</para>
|
|
|
|
<para>The <application>Perl</application> DBI modules must be installed
|
|
for some of the <application>MySQL</application> support programs to
|
|
function properly.</para>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|