2004-06-13 07:57:50 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-04-04 04:52:42 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-06-13 07:57:50 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
2004-11-19 13:14:27 +08:00
|
|
|
<!ENTITY mysql-download-http "http://mysql.he.net/Downloads/MySQL-4.1/mysql-&mysql-version;.tar.gz">
|
|
|
|
<!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.1/mysql-&mysql-version;.tar.gz">
|
2005-05-10 03:24:05 +08:00
|
|
|
<!ENTITY mysql-md5 "0b99001b07cad53f161ec629a6bb24ea">
|
|
|
|
<!ENTITY mysql-size "22 MB">
|
2005-04-06 14:56:25 +08:00
|
|
|
<!ENTITY mysql-buildsize "207 MB">
|
|
|
|
<!ENTITY mysql-time "3.83 SBU">
|
2004-06-13 07:57:50 +08:00
|
|
|
]>
|
|
|
|
|
2002-08-16 09:24:08 +08:00
|
|
|
<sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
|
2004-08-10 12:23:09 +08:00
|
|
|
<sect1info>
|
2004-08-10 12:25:57 +08:00
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
2004-08-10 12:23:09 +08:00
|
|
|
</sect1info>
|
2004-05-07 10:32:10 +08:00
|
|
|
<?dbhtml filename="mysql.html"?>
|
2002-08-16 09:24:08 +08:00
|
|
|
<title>MySQL-&mysql-version;</title>
|
2005-04-06 14:56:25 +08:00
|
|
|
<indexterm zone="mysql">
|
|
|
|
<primary sortas="a-MySQL">MySQL</primary></indexterm>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2004-06-13 07:57:50 +08:00
|
|
|
<sect2>
|
2004-07-28 14:47:21 +08:00
|
|
|
<title>Introduction to <application>My<acronym>SQL</acronym></application>
|
|
|
|
</title>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para><application>My<acronym>SQL</acronym></application> is a widely used and
|
|
|
|
fast <acronym>SQL</acronym> database server. It is a client/server
|
2004-06-13 07:57:50 +08:00
|
|
|
implementation that consists of a server daemon and many different
|
|
|
|
client programs and libraries.</para>
|
|
|
|
|
|
|
|
<sect3><title>Package information</title>
|
|
|
|
<itemizedlist spacing='compact'>
|
2005-01-11 07:55:51 +08:00
|
|
|
<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-md5;</para></listitem>
|
2004-06-13 07:57:50 +08:00
|
|
|
<listitem><para>Download size: &mysql-size;</para></listitem>
|
2005-01-11 07:55:51 +08:00
|
|
|
<listitem><para>Estimated disk space required:
|
|
|
|
&mysql-buildsize;</para></listitem>
|
|
|
|
<listitem><para>Estimated build time:
|
|
|
|
&mysql-time;</para></listitem></itemizedlist>
|
2004-06-13 07:57:50 +08:00
|
|
|
</sect3>
|
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<sect3><title><application>My<acronym>SQL</acronym></application> dependencies
|
|
|
|
</title>
|
2004-06-13 07:57:50 +08:00
|
|
|
<sect4><title>Optional</title>
|
2005-04-06 14:56:25 +08:00
|
|
|
<para><xref linkend="openssl"/>,
|
2004-11-19 13:14:27 +08:00
|
|
|
<xref linkend="tcpwrappers"/>,
|
2005-01-11 07:55:51 +08:00
|
|
|
<ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
|
|
|
|
(as an alternative to readline),
|
|
|
|
<xref linkend="ORBit"/> (detected only if <xref linkend="which"/> is
|
|
|
|
installed),
|
2005-01-26 00:02:00 +08:00
|
|
|
<xref linkend="doxygen"/> and
|
2005-04-06 14:56:25 +08:00
|
|
|
<xref linkend="tex"/></para>
|
|
|
|
</sect4>
|
2004-06-13 07:57:50 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
2004-07-28 14:47:21 +08:00
|
|
|
<title>Installation of <application>My<acronym>SQL</acronym></application>
|
|
|
|
</title>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
|
|
|
<para>For security reasons, running the server as an unprivileged user
|
|
|
|
and group is strongly encouraged:</para>
|
|
|
|
|
|
|
|
<screen><userinput><command>groupadd mysql &&
|
2005-04-06 14:56:25 +08:00
|
|
|
useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false mysql</command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para>Build and install <application>My<acronym>SQL</acronym></application> by
|
|
|
|
running the following commands:</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-10-13 03:20:40 +08:00
|
|
|
<screen><userinput><command>CPPFLAGS="-D_GNU_SOURCE" ./configure --prefix=/usr --sysconfdir=/etc \
|
2004-07-28 14:47:21 +08:00
|
|
|
--libexecdir=/usr/sbin --localstatedir=/srv/mysql \
|
|
|
|
--enable-thread-safe-client --enable-assembler \
|
2004-11-19 13:14:27 +08:00
|
|
|
--enable-local-infile --with-named-thread-libs=-lpthread \
|
2004-11-19 14:04:01 +08:00
|
|
|
--with-unix-socket-path=/var/run/mysql/mysql.sock \
|
2004-11-19 13:57:16 +08:00
|
|
|
--without-debug --without-bench --without-readline &&
|
2005-04-06 14:56:25 +08:00
|
|
|
make testdir=/usr/lib/mysql/mysql-test</command></userinput></screen>
|
|
|
|
|
2005-05-10 03:24:05 +08:00
|
|
|
<para>To test the results, issue: <command>make test</command>.</para>
|
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<para>Now, as the root user:</para>
|
|
|
|
|
|
|
|
<screen><userinput role='root'><command>make testdir=/usr/lib/mysql/mysql-test install &&
|
|
|
|
install -v -d -m755 /usr/share/mysql/Docs/Images &&
|
|
|
|
install -v -m644 Docs/manual{,_toc}.html \
|
|
|
|
Docs/manual.txt /usr/share/mysql/Docs &&
|
|
|
|
install -v -m644 Docs/Images/*.{jpg,gif} /usr/share/mysql/Docs/Images &&
|
2004-07-28 14:47:21 +08:00
|
|
|
cd /usr/lib &&
|
2005-04-06 14:56:25 +08:00
|
|
|
ln -v -sf mysql/libmysqlclient{,_r}.so* .</command></userinput></screen>
|
2004-07-28 14:47:21 +08:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Command explanations</title>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs the
|
|
|
|
<command>mysqld</command> daemon in an appropriate location.</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para><parameter>--localstatedir=/srv/mysql</parameter>: This switch forces
|
|
|
|
<application>My<acronym>SQL</acronym></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>My<acronym>SQL</acronym></application> client library.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para><parameter>--enable-assembler</parameter>: This switch allows using
|
|
|
|
assembler versions of some string functions.</para>
|
|
|
|
|
2004-11-19 13:14:27 +08:00
|
|
|
<para><parameter>--enable-local-infile</parameter>: This switch enables the
|
2004-07-28 14:47:21 +08:00
|
|
|
LOAD DATA INFILE <acronym>SQL</acronym> statement.</para>
|
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<para><parameter>CPPFLAGS="-D_GNU_SOURCE"
|
|
|
|
--with-named-thread-libs=-lpthread</parameter>: This environment variable and
|
|
|
|
configure switch enable building on <acronym>NPTL</acronym> systems.</para>
|
2004-10-13 03:20:40 +08:00
|
|
|
|
2004-11-19 13:14:27 +08:00
|
|
|
<para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
|
|
|
|
This switch puts the unix-domain socket into <filename
|
|
|
|
class="directory">/var/run/mysql</filename> directory instead of default
|
|
|
|
<filename class="directory">/tmp</filename>.</para>
|
|
|
|
|
|
|
|
<para><parameter>--without-bench</parameter>: This switch skips building the
|
|
|
|
benchmark suite.</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>
|
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para><command>make testdir=...</command>: This installs the test suite in
|
|
|
|
<filename class='directory'>/usr/lib/mysql/mysql-test</filename>.
|
|
|
|
<acronym>BLFS</acronym> is currently seeking a method to omit the installation
|
|
|
|
of the test suite altogether.</para>
|
|
|
|
|
2004-08-16 19:54:59 +08:00
|
|
|
<para><command>ln -sf mysql/libmysqlclient{,_r}.so* .</command>: This command
|
2004-07-28 14:47:21 +08:00
|
|
|
makes the <application>My<acronym>SQL</acronym></application> shared libraries
|
|
|
|
available to other packages at run-time.</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-11-19 13:14:27 +08:00
|
|
|
<para><option>--with-libwrap</option>: This switch adds tcpwrappers
|
|
|
|
support to <application>My<acronym>SQL</acronym></application>.</para>
|
|
|
|
|
|
|
|
<para><option>--with-openssl</option>: This switch adds OpenSSL support
|
|
|
|
to <application>My<acronym>SQL</acronym></application>.</para>
|
|
|
|
|
2004-06-13 07:57:50 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Configuring <application>My<acronym>SQL</acronym></application></title>
|
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<sect3 id="mysql-config">
|
2004-06-13 07:57:50 +08:00
|
|
|
<title>Config files</title>
|
|
|
|
|
|
|
|
<para><filename>/etc/my.cnf</filename>, <filename>~/.my.cnf</filename></para>
|
2005-04-06 14:56:25 +08:00
|
|
|
<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>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
|
|
|
</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
|
2005-04-06 14:56:25 +08:00
|
|
|
use. Create <filename>/etc/my.cnf</filename> using the following
|
|
|
|
command as the root user:</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<screen><userinput role='root'><command>install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf</command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
|
|
|
<para>You can now install a database and change the ownership to the
|
2005-04-06 14:56:25 +08:00
|
|
|
unprivileged user and group (perform as the root user):</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<screen><userinput role='root'><command>mysql_install_db --user=mysql &&
|
|
|
|
chgrp -v mysql /srv/mysql{,/test,/mysql}</command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para>Further configuration requires that the
|
2005-04-06 14:56:25 +08:00
|
|
|
<application>My<acronym>SQL</acronym></application> server be running. Start
|
|
|
|
the server using the following commands as the root user:</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<screen><userinput role='root'><command>install -v -m750 -o mysql -g mysql -d /var/run/mysql &&
|
2004-11-19 13:57:16 +08:00
|
|
|
mysqld_safe --user=mysql 2>&1 >/dev/null &</command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para>A default installation does not setup a password for the administrator,
|
2005-04-06 14:56:25 +08:00
|
|
|
so use the following command as the root user to set one. Replace
|
2004-07-28 14:47:21 +08:00
|
|
|
<replaceable>[new-password]</replaceable> with your own.</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<screen><userinput role='root'><command>mysqladmin -u root password <replaceable>[new-password]</replaceable></command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
|
|
|
<para>Configuration of the server is now finished. Shut the server down
|
2005-04-06 14:56:25 +08:00
|
|
|
using the following command as the root user:</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<screen><userinput role='root'><command>mysqladmin -p shutdown</command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<para id="mysql-init">Install the <filename>/etc/rc.d/init.d/mysql</filename>
|
2004-07-28 14:47:21 +08:00
|
|
|
init script included in the <xref linkend="intro-important-bootscripts"/>
|
2005-04-06 14:56:25 +08:00
|
|
|
package as the root 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>
|
2004-07-28 14:47:21 +08:00
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<screen><userinput role='root'><command>make install-mysql</command></userinput></screen>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Contents</title>
|
|
|
|
|
2005-04-06 14:56:25 +08:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed Programs</segtitle>
|
|
|
|
<segtitle>Installed Libraries</segtitle>
|
|
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
|
|
|
|
<seglistitem>
|
|
|
|
<seg>comp_err, isamchk, isamlog, make_win_binary_distribution,
|
|
|
|
make_win_src_distribution, 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, mysqlmanager-pwgen, mysqlmanagerc, mysqlshow, mysqltest,
|
|
|
|
pack_isam, perror, replace, resolve_stack_dump and resolveip</seg>
|
|
|
|
<seg>libdbug.a, libheap.a, libmerge.a, libmyisam.a, libmyisammrg.a,
|
|
|
|
libmysqlclient.[so,a], libmysqlclient_r.[so,a], libmystrings.a, libmysys.a,
|
|
|
|
libnisam.a and libvio.a</seg>
|
|
|
|
<seg>/srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql and
|
|
|
|
/var/run/mysql</seg>
|
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<sect3><title>Short description</title>
|
|
|
|
<para>Descriptions of all the programs and libraries would be several pages
|
|
|
|
long. Instead, consult the <application>My<acronym>SQL</acronym></application>
|
|
|
|
documentation for full details.</para>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
2004-07-28 14:47:21 +08:00
|
|
|
<para>Certain <application>My<acronym>SQL</acronym></application> support
|
|
|
|
programs may require the <application>Perl</application> DBI modules to be
|
|
|
|
installed to function properly.</para>
|
2005-04-06 14:56:25 +08:00
|
|
|
</sect3>
|
2004-06-13 07:57:50 +08:00
|
|
|
|
|
|
|
</sect2>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
|
|
|
</sect1>
|