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