[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[867e611] | 7 | <!ENTITY mysql-download-http "http://mysql.he.net/Downloads/MySQL-4.1/mysql-&mysql-version;.tar.gz">
|
---|
| 8 | <!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.1/mysql-&mysql-version;.tar.gz">
|
---|
| 9 | <!ENTITY mysql-md5 "04c08d2a5cc39050d9fa4727f8f197e8">
|
---|
| 10 | <!ENTITY mysql-size "19 MB">
|
---|
[54b4a3e] | 11 | <!ENTITY mysql-buildsize "117 MB">
|
---|
| 12 | <!ENTITY mysql-time "2.83 SBU">
|
---|
[08254fc] | 13 | ]>
|
---|
| 14 |
|
---|
[c30b739] | 15 | <sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
|
---|
[a0f03b0] | 16 | <sect1info>
|
---|
[5cd0959d] | 17 | <othername>$LastChangedBy$</othername>
|
---|
| 18 | <date>$Date$</date>
|
---|
[a0f03b0] | 19 | </sect1info>
|
---|
[00bb024c] | 20 | <?dbhtml filename="mysql.html"?>
|
---|
[c30b739] | 21 | <title>MySQL-&mysql-version;</title>
|
---|
[f45b1953] | 22 |
|
---|
[08254fc] | 23 | <sect2>
|
---|
[4b93ac2] | 24 | <title>Introduction to <application>My<acronym>SQL</acronym></application>
|
---|
| 25 | </title>
|
---|
[08254fc] | 26 |
|
---|
[4b93ac2] | 27 | <para><application>My<acronym>SQL</acronym></application> is a widely used and
|
---|
| 28 | fast <acronym>SQL</acronym> database server. It is a client/server
|
---|
[08254fc] | 29 | implementation that consists of a server daemon and many different
|
---|
| 30 | client programs and libraries.</para>
|
---|
| 31 |
|
---|
| 32 | <sect3><title>Package information</title>
|
---|
| 33 | <itemizedlist spacing='compact'>
|
---|
| 34 | <listitem><para>Download (HTTP): <ulink url="&mysql-download-http;"/></para></listitem>
|
---|
| 35 | <listitem><para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para></listitem>
|
---|
[dc2f5ad] | 36 | <listitem><para>Download MD5 Sum: &mysql-md5;</para></listitem>
|
---|
[08254fc] | 37 | <listitem><para>Download size: &mysql-size;</para></listitem>
|
---|
[54b4a3e] | 38 | <listitem><para>Estimated disk space required: &mysql-buildsize;</para></listitem>
|
---|
[08254fc] | 39 | <listitem><para>Estimated build time: &mysql-time;</para></listitem></itemizedlist>
|
---|
| 40 | </sect3>
|
---|
| 41 |
|
---|
[4b93ac2] | 42 | <sect3><title><application>My<acronym>SQL</acronym></application> dependencies
|
---|
| 43 | </title>
|
---|
[08254fc] | 44 | <sect4><title>Optional</title>
|
---|
[867e611] | 45 | <para>
|
---|
| 46 | <xref linkend="openssl"/>,
|
---|
| 47 | <xref linkend="tcpwrappers"/>,
|
---|
| 48 | <ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink> (as an alternative to readline),
|
---|
| 49 | <xref linkend="ORBit"/> (detected only if <xref linkend="which"/> is installed),
|
---|
| 50 | <xref linkend="doxygen"/> and
|
---|
| 51 | <xref linkend="pst-typesetting-tex"/>
|
---|
[08254fc] | 52 | </para></sect4>
|
---|
| 53 | </sect3>
|
---|
| 54 |
|
---|
| 55 | </sect2>
|
---|
| 56 |
|
---|
| 57 | <sect2>
|
---|
[4b93ac2] | 58 | <title>Installation of <application>My<acronym>SQL</acronym></application>
|
---|
| 59 | </title>
|
---|
[08254fc] | 60 |
|
---|
| 61 | <para>For security reasons, running the server as an unprivileged user
|
---|
| 62 | and group is strongly encouraged:</para>
|
---|
| 63 |
|
---|
| 64 | <screen><userinput><command>groupadd mysql &&
|
---|
| 65 | useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql</command></userinput></screen>
|
---|
| 66 |
|
---|
[4b93ac2] | 67 | <para>Build and install <application>My<acronym>SQL</acronym></application> by
|
---|
| 68 | running the following commands:</para>
|
---|
[08254fc] | 69 |
|
---|
[c2c2d76] | 70 | <screen><userinput><command>CPPFLAGS="-D_GNU_SOURCE" ./configure --prefix=/usr --sysconfdir=/etc \
|
---|
[4b93ac2] | 71 | --libexecdir=/usr/sbin --localstatedir=/srv/mysql \
|
---|
| 72 | --enable-thread-safe-client --enable-assembler \
|
---|
[867e611] | 73 | --enable-local-infile --with-named-thread-libs=-lpthread \
|
---|
[d0abeb0] | 74 | --with-unix-socket-path=/var/run/mysql/mysql.sock \
|
---|
[ac109439] | 75 | --without-debug --without-bench --without-readline &&
|
---|
[08254fc] | 76 | make testdir=/usr/lib/mysql/mysql-test &&
|
---|
[4b93ac2] | 77 | make testdir=/usr/lib/mysql/mysql-test install &&
|
---|
| 78 | cd /usr/lib &&
|
---|
| 79 | ln -sf mysql/libmysqlclient{,_r}.so* .</command></userinput></screen>
|
---|
| 80 |
|
---|
| 81 | </sect2>
|
---|
| 82 |
|
---|
| 83 | <sect2>
|
---|
| 84 | <title>Command explanations</title>
|
---|
[08254fc] | 85 |
|
---|
[4b93ac2] | 86 | <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs the
|
---|
| 87 | <command>mysqld</command> daemon in an appropriate location.</para>
|
---|
[08254fc] | 88 |
|
---|
[4b93ac2] | 89 | <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch forces
|
---|
| 90 | <application>My<acronym>SQL</acronym></application> to use
|
---|
| 91 | <filename class='directory'>/srv/mysql</filename> for database files and other
|
---|
| 92 | variable data.</para>
|
---|
| 93 |
|
---|
| 94 | <para><parameter>--enable-thread-safe-client</parameter>: This switch compiles a
|
---|
| 95 | thread-safe <application>My<acronym>SQL</acronym></application> client library.
|
---|
| 96 | </para>
|
---|
| 97 |
|
---|
| 98 | <para><parameter>--enable-assembler</parameter>: This switch allows using
|
---|
| 99 | assembler versions of some string functions.</para>
|
---|
| 100 |
|
---|
[867e611] | 101 | <para><parameter>--enable-local-infile</parameter>: This switch enables the
|
---|
[4b93ac2] | 102 | LOAD DATA INFILE <acronym>SQL</acronym> statement.</para>
|
---|
| 103 |
|
---|
[c2c2d76] | 104 | <para><parameter>CPPFLAGS="-D_GNU_SOURCE" --with-named-thread-libs=-lpthread</parameter>:
|
---|
| 105 | This environment variable and configure switch enable building on
|
---|
| 106 | <acronym>NPTL</acronym> systems.</para>
|
---|
| 107 |
|
---|
[867e611] | 108 | <para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
|
---|
| 109 | This switch puts the unix-domain socket into <filename
|
---|
| 110 | class="directory">/var/run/mysql</filename> directory instead of default
|
---|
| 111 | <filename class="directory">/tmp</filename>.</para>
|
---|
| 112 |
|
---|
| 113 | <para><parameter>--without-bench</parameter>: This switch skips building the
|
---|
| 114 | benchmark suite.</para>
|
---|
| 115 |
|
---|
| 116 | <para><parameter>--without-readline</parameter>: This switch forces the build
|
---|
| 117 | to use the system copy of <application>readline</application> instead of the
|
---|
| 118 | bundled copy.</para>
|
---|
| 119 |
|
---|
[4b93ac2] | 120 | <para><command>make testdir=...</command>: This installs the test suite in
|
---|
| 121 | <filename class='directory'>/usr/lib/mysql/mysql-test</filename>.
|
---|
| 122 | <acronym>BLFS</acronym> is currently seeking a method to omit the installation
|
---|
| 123 | of the test suite altogether.</para>
|
---|
| 124 |
|
---|
[2fa0880] | 125 | <para><command>ln -sf mysql/libmysqlclient{,_r}.so* .</command>: This command
|
---|
[4b93ac2] | 126 | makes the <application>My<acronym>SQL</acronym></application> shared libraries
|
---|
| 127 | available to other packages at run-time.</para>
|
---|
[08254fc] | 128 |
|
---|
[867e611] | 129 | <para><option>--with-libwrap</option>: This switch adds tcpwrappers
|
---|
| 130 | support to <application>My<acronym>SQL</acronym></application>.</para>
|
---|
| 131 |
|
---|
| 132 | <para><option>--with-openssl</option>: This switch adds OpenSSL support
|
---|
| 133 | to <application>My<acronym>SQL</acronym></application>.</para>
|
---|
| 134 |
|
---|
[08254fc] | 135 | </sect2>
|
---|
| 136 |
|
---|
| 137 | <sect2>
|
---|
| 138 | <title>Configuring <application>My<acronym>SQL</acronym></application></title>
|
---|
| 139 |
|
---|
| 140 | <sect3>
|
---|
| 141 | <title>Config files</title>
|
---|
| 142 |
|
---|
| 143 | <para><filename>/etc/my.cnf</filename>, <filename>~/.my.cnf</filename></para>
|
---|
| 144 |
|
---|
| 145 | </sect3>
|
---|
| 146 |
|
---|
| 147 | <sect3>
|
---|
| 148 | <title>Configuration Information</title>
|
---|
| 149 |
|
---|
| 150 | <para>There are several default configuration files available in
|
---|
| 151 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
| 152 | use. Create <filename>/etc/my.cnf</filename> using the following
|
---|
| 153 | command:</para>
|
---|
| 154 |
|
---|
[c69b94a3] | 155 | <screen><userinput><command>cp /usr/share/mysql/my-large.cnf /etc/my.cnf</command></userinput></screen>
|
---|
[08254fc] | 156 |
|
---|
| 157 | <para>You can now install a database and change the ownership to the
|
---|
| 158 | unprivileged user and group.</para>
|
---|
| 159 |
|
---|
[ac109439] | 160 | <screen><userinput><command>mysql_install_db --user=mysql</command></userinput></screen>
|
---|
[08254fc] | 161 |
|
---|
[4b93ac2] | 162 | <para>Further configuration requires that the
|
---|
| 163 | <application>My<acronym>SQL</acronym></application> server be running:</para>
|
---|
[08254fc] | 164 |
|
---|
[ac109439] | 165 | <screen><userinput><command>install -o mysql -d /var/run/mysql &&
|
---|
| 166 | mysqld_safe --user=mysql 2>&1 >/dev/null &</command></userinput></screen>
|
---|
[08254fc] | 167 |
|
---|
[4b93ac2] | 168 | <para>A default installation does not setup a password for the administrator,
|
---|
| 169 | so use the following command to set one. Replace
|
---|
| 170 | <replaceable>[new-password]</replaceable> with your own.</para>
|
---|
[08254fc] | 171 |
|
---|
| 172 | <screen><userinput><command>mysqladmin -u root password <replaceable>[new-password]</replaceable></command></userinput></screen>
|
---|
| 173 |
|
---|
| 174 | <para>Configuration of the server is now finished. Shut the server down
|
---|
| 175 | using the following command:</para>
|
---|
| 176 |
|
---|
| 177 | <screen><userinput><command>mysqladmin -p shutdown</command></userinput></screen>
|
---|
| 178 |
|
---|
| 179 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename>
|
---|
[4b93ac2] | 180 | init script included in the <xref linkend="intro-important-bootscripts"/>
|
---|
| 181 | package.</para>
|
---|
| 182 |
|
---|
[08254fc] | 183 | <screen><userinput><command>make install-mysql</command></userinput></screen>
|
---|
| 184 |
|
---|
| 185 | </sect3>
|
---|
| 186 |
|
---|
| 187 | </sect2>
|
---|
| 188 |
|
---|
| 189 | <sect2>
|
---|
| 190 | <title>Contents</title>
|
---|
| 191 |
|
---|
[54b4a3e] | 192 | <para>The <application>My<acronym>SQL</acronym></application> package contains
|
---|
[867e611] | 193 | <command>client_test</command>,
|
---|
[54b4a3e] | 194 | <command>comp_err</command>, <command>
|
---|
[08254fc] | 195 | isamchk</command>, <command>
|
---|
| 196 | isamlog</command>, <command>
|
---|
[4b93ac2] | 197 | make_win_binary_distribution</command>, <command>
|
---|
[08254fc] | 198 | make_win_src_distribution</command>, <command>
|
---|
| 199 | msql2mysql</command>, <command>
|
---|
| 200 | my_print_defaults</command>, <command>
|
---|
[4b93ac2] | 201 | myisam_ftdump</command>, <command>
|
---|
[08254fc] | 202 | myisamchk</command>, <command>
|
---|
| 203 | myisamlog</command>, <command>
|
---|
| 204 | myisampack</command>, <command>
|
---|
| 205 | mysql</command>, <command>
|
---|
| 206 | mysql_config</command>, <command>
|
---|
| 207 | mysql_convert_table_format</command>, <command>
|
---|
[867e611] | 208 | mysql_create_system_tables</command>, <command>
|
---|
[08254fc] | 209 | mysql_explain_log</command>, <command>
|
---|
| 210 | mysql_find_rows</command>, <command>
|
---|
| 211 | mysql_fix_extensions</command>, <command>
|
---|
| 212 | mysql_fix_privilege_tables</command>, <command>
|
---|
| 213 | mysql_install_db</command>, <command>
|
---|
| 214 | mysql_secure_installation</command>, <command>
|
---|
| 215 | mysql_setpermission</command>, <command>
|
---|
| 216 | mysql_tableinfo</command>, <command>
|
---|
[867e611] | 217 | mysql_tzinfo_to_sql</command>, <command>
|
---|
[08254fc] | 218 | mysql_waitpid</command>, <command>
|
---|
| 219 | mysql_zap</command>, <command>
|
---|
| 220 | mysqlacess</command>,<command>
|
---|
| 221 | mysqladmin</command>, <command>
|
---|
| 222 | mysqlbinlog</command>, <command>
|
---|
| 223 | mysqlbug</command>, <command>
|
---|
| 224 | mysqlcheck</command>, <command>
|
---|
| 225 | mysqld</command>, <command>
|
---|
| 226 | mysqld_multi</command>, <command>
|
---|
| 227 | mysqld_safe</command>, <command>
|
---|
| 228 | mysqldump</command>, <command>
|
---|
| 229 | mysqldumpslow</command>, <command>
|
---|
| 230 | mysqlhotcopy</command>, <command>
|
---|
| 231 | mysqlimport</command>, <command>
|
---|
| 232 | mysqlmanager</command>, <command>
|
---|
| 233 | mysqlmanager-pwgen</command>, <command>
|
---|
| 234 | mysqlmanagerc</command>, <command>
|
---|
| 235 | mysqlshow</command>, <command>
|
---|
| 236 | mysqltest</command>, <command>
|
---|
| 237 | pack_isam</command>, <command>
|
---|
| 238 | perror</command>, <command>
|
---|
| 239 | replace</command>, <command>
|
---|
| 240 | resolve_stack_dump</command>, <command>
|
---|
| 241 | resolveip</command>, <filename class="libraryfile">
|
---|
| 242 | libdbug</filename>, <filename class="libraryfile">
|
---|
| 243 | libheap</filename>, <filename class="libraryfile">
|
---|
| 244 | libmerge</filename>, <filename class="libraryfile">
|
---|
| 245 | libmyisam</filename>, <filename class="libraryfile">
|
---|
| 246 | libmyisammrg</filename>, <filename class="libraryfile">
|
---|
| 247 | libmysqlclient</filename>, <filename class="libraryfile">
|
---|
[4b93ac2] | 248 | libmysqlclient_r</filename>, <filename class="libraryfile">
|
---|
[08254fc] | 249 | libmystrings</filename>, <filename class="libraryfile">
|
---|
| 250 | libmysys</filename>, <filename class="libraryfile">
|
---|
| 251 | libnisam</filename> and <filename class="libraryfile">
|
---|
| 252 | libvio</filename>.</para>
|
---|
| 253 |
|
---|
| 254 | </sect2>
|
---|
| 255 |
|
---|
| 256 | <sect2><title>Description</title>
|
---|
| 257 |
|
---|
[4b93ac2] | 258 | <para>A package listing would be several pages long. Consult the
|
---|
| 259 | <application>My<acronym>SQL</acronym></application> documentation for full
|
---|
| 260 | details instead.</para>
|
---|
[08254fc] | 261 |
|
---|
[4b93ac2] | 262 | <para>Certain <application>My<acronym>SQL</acronym></application> support
|
---|
| 263 | programs may require the <application>Perl</application> DBI modules to be
|
---|
| 264 | installed to function properly.</para>
|
---|
[08254fc] | 265 |
|
---|
| 266 | </sect2>
|
---|
[f45b1953] | 267 |
|
---|
| 268 | </sect1>
|
---|