2004-06-13 07:57:50 +08:00
<?xml version="1.0" encoding="ISO-8859-1"?>
< !DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY mysql-download-http "http://mysql.he.net/Downloads/MySQL-4.0/mysql-&mysql-version;.tar.gz">
<!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.0/mysql-&mysql-version;.tar.gz">
2004-09-25 09:52:30 +08:00
<!ENTITY mysql-md5 "7c75ac74e23396bd228dbc2c2d1131df">
2004-06-13 07:57:50 +08:00
<!ENTITY mysql-size "13.5 MB">
<!ENTITY mysql-buildsize "98.7 MB">
<!ENTITY mysql-time "3.43 SBU">
]>
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>
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' >
<listitem > <para > Download (HTTP): <ulink url= "&mysql-download-http;" /> </para> </listitem>
<listitem > <para > Download (FTP): <ulink url= "&mysql-download-ftp;" /> </para> </listitem>
2004-09-25 09:52:30 +08:00
<listitem > <para > MD5 Sum: &mysql-size; </para> </listitem>
2004-06-13 07:57:50 +08:00
<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>
</sect3>
2004-07-28 14:47:21 +08:00
<sect3 > <title > Additional downloads</title>
<itemizedlist spacing= 'compact' >
<listitem > <para > Required Patch (for building against NPTL): <ulink
url="&patch-root; /mysql-&mysql-version; -nptl-1.patch"/></para> </listitem>
</itemizedlist> </sect3>
<sect3 > <title > <application > My<acronym > SQL</acronym> </application> dependencies
</title>
2004-06-13 07:57:50 +08:00
<sect4 > <title > Optional</title>
2004-08-03 04:17:31 +08:00
<para > <xref linkend= "openssl" /> , <xref linkend= "tcpwrappers" /> ,
<xref linkend= "which" /> and <xref linkend= "ORBit" />
2004-06-13 07:57:50 +08:00
</para> </sect4>
</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 & &
useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql</command> </userinput> </screen>
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-07-28 14:47:21 +08:00
<screen > <userinput > <command > patch -Np1 -i ../mysql-&mysql-version; -nptl-1.patch & &
./configure --prefix=/usr --sysconfdir=/etc \
--libexecdir=/usr/sbin --localstatedir=/srv/mysql \
--enable-thread-safe-client --enable-assembler \
--without-readline --without-debug \
--enable-local-infile --without-bench & &
2004-06-13 07:57:50 +08:00
make testdir=/usr/lib/mysql/mysql-test & &
2004-07-28 14:47:21 +08:00
make testdir=/usr/lib/mysql/mysql-test install & &
cd /usr/lib & &
ln -sf mysql/libmysqlclient{,_r}.so* .</command> </userinput> </screen>
</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>
<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 > <option > --enable-local-infile</option> : This switch enables the
LOAD DATA INFILE <acronym > SQL</acronym> statement.</para>
<para > <option > --without-bench</option> : This switch skips building the
benchmark suite.</para>
<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
</sect2>
<sect2 >
<title > Configuring <application > My<acronym > SQL</acronym> </application> </title>
<sect3 >
<title > Config files</title>
<para > <filename > /etc/my.cnf</filename> , <filename > ~/.my.cnf</filename> </para>
</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:</para>
<screen > <userinput > <command > cp /usr/share/mysql/my-medium.cnf /etc/my.cnf</command> </userinput> </screen>
<para > You can now install a database and change the ownership to the
unprivileged user and group.</para>
<screen > <userinput > <command > mysql_install_db & &
2004-07-28 14:47:21 +08:00
chown -R mysql:mysql /srv/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
<application > My<acronym > SQL</acronym> </application> server be running:</para>
2004-06-13 07:57:50 +08:00
<screen > <userinput > <command > mysqld_safe --user=mysql 2> & 1 > /dev/null & </command> </userinput> </screen>
2004-07-28 14:47:21 +08:00
<para > A default installation does not setup a password for the administrator,
so use the following command to set one. Replace
<replaceable > [new-password]</replaceable> with your own.</para>
2004-06-13 07:57:50 +08:00
2004-03-05 15:09:18 +08:00
<!--
2004-06-13 07:57:50 +08:00
<screen > <userinput > <command > mysql -uroot mysql</command> </userinput>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.51-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
<prompt > mysql> </prompt> <userinput > <command > UPDATE user SET password=password('<replaceable > new-password</replaceable> ') WHERE user='root';</command> </userinput>
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
<prompt > mysql> </prompt> <userinput > <command > FLUSH PRIVILEGES;</command> </userinput>
Query OK, 0 rows affected (0.00 sec)
<prompt > mysql> </prompt> <userinput > <command > EXIT;</command> </userinput>
bye
</screen>
2004-03-05 15:09:18 +08:00
-->
2004-06-13 07:57:50 +08:00
<screen > <userinput > <command > mysqladmin -u root password <replaceable > [new-password]</replaceable> </command> </userinput> </screen>
<para > Configuration of the server is now finished. Shut the server down
using the following command:</para>
<screen > <userinput > <command > mysqladmin -p shutdown</command> </userinput> </screen>
<para > 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" />
package.</para>
2004-06-13 07:57:50 +08:00
<screen > <userinput > <command > make install-mysql</command> </userinput> </screen>
</sect3>
</sect2>
<sect2 >
<title > Contents</title>
<para > The <application > My<acronym > SQL</acronym> </application> package contains <command >
comp_err</command> , <command >
isamchk</command> , <command >
isamlog</command> , <command >
2004-07-28 14:47:21 +08:00
make_win_binary_distribution</command> , <command >
2004-06-13 07:57:50 +08:00
make_win_src_distribution</command> , <command >
msql2mysql</command> , <command >
my_print_defaults</command> , <command >
2004-07-28 14:47:21 +08:00
myisam_ftdump</command> , <command >
2004-06-13 07:57:50 +08:00
myisamchk</command> , <command >
myisamlog</command> , <command >
myisampack</command> , <command >
mysql</command> , <command >
mysql_config</command> , <command >
mysql_convert_table_format</command> , <command >
mysql_explain_log</command> , <command >
mysql_find_rows</command> , <command >
mysql_fix_extensions</command> , <command >
mysql_fix_privilege_tables</command> , <command >
mysql_install</command> , <command >
mysql_install_db</command> , <command >
mysql_secure_installation</command> , <command >
mysql_setpermission</command> , <command >
mysql_tableinfo</command> , <command >
mysql_waitpid</command> , <command >
mysql_zap</command> , <command >
mysqlacess</command> ,<command >
mysqladmin</command> , <command >
mysqlbinlog</command> , <command >
mysqlbug</command> , <command >
mysqlcheck</command> , <command >
mysqld</command> , <command >
mysqld_multi</command> , <command >
mysqld_safe</command> , <command >
mysqldump</command> , <command >
mysqldumpslow</command> , <command >
mysqlhotcopy</command> , <command >
mysqlimport</command> , <command >
mysqlmanager</command> , <command >
mysqlmanager-pwgen</command> , <command >
mysqlmanagerc</command> , <command >
mysqlshow</command> , <command >
mysqltest</command> , <command >
pack_isam</command> , <command >
perror</command> , <command >
replace</command> , <command >
resolve_stack_dump</command> , <command >
resolveip</command> , <filename class= "libraryfile" >
libdbug</filename> , <filename class= "libraryfile" >
libheap</filename> , <filename class= "libraryfile" >
libmerge</filename> , <filename class= "libraryfile" >
libmyisam</filename> , <filename class= "libraryfile" >
libmyisammrg</filename> , <filename class= "libraryfile" >
libmysqlclient</filename> , <filename class= "libraryfile" >
2004-07-28 14:47:21 +08:00
libmysqlclient_r</filename> , <filename class= "libraryfile" >
2004-06-13 07:57:50 +08:00
libmystrings</filename> , <filename class= "libraryfile" >
libmysys</filename> , <filename class= "libraryfile" >
libnisam</filename> and <filename class= "libraryfile" >
libvio</filename> .</para>
</sect2>
<sect2 > <title > Description</title>
2004-07-28 14:47:21 +08:00
<para > A package listing would be several pages long. Consult the
<application > My<acronym > SQL</acronym> </application> documentation for full
details instead.</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>
2004-06-13 07:57:50 +08:00
</sect2>
2002-07-08 04:28:42 +08:00
</sect1>