[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;
|
---|
[68196987] | 6 |
|
---|
[9dfd852b] | 7 | <!ENTITY mysql-download-http "http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz/from/http://mysql.mirrors.hoobly.com/">
|
---|
| 8 | <!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz">
|
---|
[afb1341] | 9 | <!ENTITY mysql-md5sum "c3165204c42e1db6fc3a95a4fd2cd22f">
|
---|
[9b603d4] | 10 | <!ENTITY mysql-size "18.6 MB">
|
---|
[afb1341] | 11 | <!ENTITY mysql-buildsize "244 MB (additional 194 MB to run the test suite)">
|
---|
[9b603d4] | 12 | <!ENTITY mysql-time "4.5 SBU (Test suite is an additional 48 minutes, only partially CPU dependent)">
|
---|
[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>
|
---|
[9b603d4] | 65 | <para role="optional"><xref linkend="openssl"/> and
|
---|
| 66 | <xref linkend="tcpwrappers"/>.
|
---|
| 67 |
|
---|
| 68 | <!-- Removing libedit because it causes more problems than it solves.
|
---|
| 69 |
|
---|
[22c7fe6] | 70 | <ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
|
---|
[9b603d4] | 71 | (as an alternative to readline)-->
|
---|
| 72 |
|
---|
| 73 | </para>
|
---|
[9dfd852b] | 74 |
|
---|
| 75 | <!-- These appear to be obsolete now that the docs have been pulled
|
---|
| 76 | out of the main tarball. Configure still checks for them, but
|
---|
| 77 | best I can tell, they are not used, nor can be used even if found
|
---|
| 78 |
|
---|
[22c7fe6] | 79 | <xref linkend="doxygen"/> and
|
---|
[520f6b4f] | 80 | <xref linkend="tetex"/></para>
|
---|
[9dfd852b] | 81 | -->
|
---|
[22c7fe6] | 82 |
|
---|
[3cb0c57] | 83 | <para condition="html" role="usernotes">User Notes:
|
---|
| 84 | <ulink url="&blfs-wiki;/mysql"/></para>
|
---|
| 85 |
|
---|
[22c7fe6] | 86 | </sect2>
|
---|
| 87 |
|
---|
| 88 | <sect2 role="installation">
|
---|
| 89 | <title>Installation of MySQL</title>
|
---|
| 90 |
|
---|
| 91 | <para>For security reasons, running the server as an unprivileged user
|
---|
| 92 | and group is strongly encouraged:</para>
|
---|
| 93 |
|
---|
[b785ab29] | 94 | <screen role="root"><userinput>groupadd -g 40 mysql &&
|
---|
| 95 | useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false \
|
---|
| 96 | -u 40 mysql</userinput></screen>
|
---|
[22c7fe6] | 97 |
|
---|
| 98 | <para>Build and install <application>MySQL</application> by
|
---|
| 99 | running the following commands:</para>
|
---|
| 100 |
|
---|
[6473e74] | 101 | <!-- Removing the CPPFLAGS="-D_GNU_SOURCE" and
|
---|
[9dfd852b] | 102 | -with-named-thread-libs=-lpthread as they don't appear to be
|
---|
| 103 | required any longer
|
---|
| 104 | -->
|
---|
| 105 |
|
---|
[db70961a] | 106 | <screen><userinput>C_EXTRA_FLAGS=-fno-strict-aliasing \
|
---|
[9b603d4] | 107 | ./configure --prefix=/usr \
|
---|
[9dfd852b] | 108 | --sysconfdir=/etc \
|
---|
| 109 | --libexecdir=/usr/sbin \
|
---|
| 110 | --localstatedir=/srv/mysql \
|
---|
| 111 | --enable-thread-safe-client \
|
---|
| 112 | --enable-assembler \
|
---|
| 113 | --enable-local-infile \
|
---|
| 114 | --with-unix-socket-path=/var/run/mysql/mysql.sock \
|
---|
| 115 | --without-debug \
|
---|
| 116 | --without-bench \
|
---|
[9b603d4] | 117 | --without-readline \
|
---|
| 118 | --with-berkeley-db \
|
---|
| 119 | --with-extra-charsets=all &&
|
---|
[9dfd852b] | 120 | make testdir=/tmp/mysql</userinput></screen>
|
---|
| 121 |
|
---|
[9b603d4] | 122 | <!--
|
---|
[9dfd852b] | 123 | <para>Some of the tests in the test suite are known to fail and this will
|
---|
| 124 | cause the test suite to abort at that point. Issue the following command
|
---|
| 125 | to disable the tests known to fail:</para>
|
---|
| 126 |
|
---|
| 127 | <screen><userinput>for TESTFILE in information_schema innodb join mysql_client_test \
|
---|
| 128 | ps_2myisam ps_3innodb ps_4heap ps_5merge \
|
---|
| 129 | sp-error strict type_float type_ranges
|
---|
| 130 | do
|
---|
| 131 | mv mysql-test/t/$TESTFILE.test mysql-test/t/$TESTFILE.test.disabled
|
---|
| 132 | done
|
---|
| 133 | unset TESTFILE</userinput></screen>
|
---|
[9b603d4] | 134 | -->
|
---|
[68196987] | 135 |
|
---|
| 136 | <para>To test the results, issue: <command>make test</command>. Note that
|
---|
| 137 | if you have a restrictive <filename>/etc/hosts.deny</filename> file, you
|
---|
| 138 | will need to add an appropriate entry to the
|
---|
| 139 | <filename>/etc/hosts.allow</filename> file for the
|
---|
| 140 | <command>mysqld</command> daemon, else many of the tests will fail.</para>
|
---|
[9e69cae] | 141 |
|
---|
[22c7fe6] | 142 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[20f5e71a] | 143 |
|
---|
[9dfd852b] | 144 | <screen role="root"><userinput>make testdir=/tmp/mysql install &&
|
---|
| 145 | rm -rf /tmp/mysql &&
|
---|
[4b93ac2] | 146 | cd /usr/lib &&
|
---|
[22c7fe6] | 147 | ln -v -sf mysql/libmysqlclient{,_r}.so* .</userinput></screen>
|
---|
[4b93ac2] | 148 |
|
---|
[bccbdaea] | 149 | <!-- Insert this back into the 'root' installation section if
|
---|
[36769b3] | 150 | there are ever docs to install again
|
---|
| 151 |
|
---|
| 152 | install -v -d -m755 /usr/share/mysql/Docs/Images &&
|
---|
| 153 | install -v -m644 Docs/manual{,_toc}.html \
|
---|
| 154 | Docs/manual.txt /usr/share/mysql/Docs &&
|
---|
| 155 | install -v -m644 Docs/Images/*.{jpg,gif} /usr/share/mysql/Docs/Images &&
|
---|
| 156 |
|
---|
| 157 | -->
|
---|
| 158 |
|
---|
[22c7fe6] | 159 | </sect2>
|
---|
[4b93ac2] | 160 |
|
---|
[22c7fe6] | 161 | <sect2 role="commands">
|
---|
| 162 | <title>Command Explanations</title>
|
---|
[08254fc] | 163 |
|
---|
[db70961a] | 164 | <para><parameter>C_EXTRA_FLAGS=-fno-strict-aliasing</parameter>: This
|
---|
[aa13abce] | 165 | environment variable adjusts the compiler optimization to avoid failures in
|
---|
| 166 | the testsuite and other operations.</para>
|
---|
[9b603d4] | 167 |
|
---|
[22c7fe6] | 168 | <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs
|
---|
[9dfd852b] | 169 | the <command>mysqld</command> daemon and the
|
---|
| 170 | <command>mysqlmanager</command> program in an appropriate location.</para>
|
---|
[08254fc] | 171 |
|
---|
[22c7fe6] | 172 | <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch
|
---|
| 173 | forces <application>MySQL</application> to use
|
---|
| 174 | <filename class='directory'>/srv/mysql</filename> for database files and
|
---|
| 175 | other variable data.</para>
|
---|
[4b93ac2] | 176 |
|
---|
[22c7fe6] | 177 | <para><parameter>--enable-thread-safe-client</parameter>: This
|
---|
| 178 | switch compiles a thread-safe <application>MySQL</application> client
|
---|
| 179 | library.</para>
|
---|
[4b93ac2] | 180 |
|
---|
[22c7fe6] | 181 | <para><parameter>--enable-assembler</parameter>: This switch allows using
|
---|
| 182 | assembler versions of some string functions.</para>
|
---|
[4b93ac2] | 183 |
|
---|
[22c7fe6] | 184 | <para><parameter>--enable-local-infile</parameter>: This switch enables
|
---|
| 185 | the <quote>LOAD DATA INFILE</quote> SQL statement.</para>
|
---|
[4b93ac2] | 186 |
|
---|
[22c7fe6] | 187 | <para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
|
---|
[db9754e] | 188 | This switch puts the unix-domain socket into the
|
---|
| 189 | <filename class="directory">/var/run/mysql</filename> directory instead of
|
---|
| 190 | the default <filename class="directory">/tmp</filename>.</para>
|
---|
[867e611] | 191 |
|
---|
[22c7fe6] | 192 | <para><parameter>--without-bench</parameter>: This switch skips building
|
---|
| 193 | the benchmark suite.</para>
|
---|
[867e611] | 194 |
|
---|
[22c7fe6] | 195 | <para><parameter>--without-readline</parameter>: This switch forces the
|
---|
| 196 | build to use the system copy of <application>readline</application> instead
|
---|
| 197 | of the bundled copy.</para>
|
---|
[867e611] | 198 |
|
---|
[9b603d4] | 199 | <para><parameter>--with-berkeley-db</parameter>: This switch enables
|
---|
| 200 | using <application>Berkeley DB</application> tables as a back end.</para>
|
---|
| 201 |
|
---|
| 202 | <para><parameter>--with-extra-charsets=all</parameter>: This switch enables
|
---|
| 203 | international character sets within the suite.</para>
|
---|
| 204 |
|
---|
[22c7fe6] | 205 | <para><command>make testdir=...</command>: This installs the test suite in
|
---|
[9dfd852b] | 206 | <filename class='directory'>/tmp/mysql</filename>. The test suite is not
|
---|
| 207 | required, nor does it function properly on an installed version of
|
---|
| 208 | <application>MySQL</application>, so it is removed in the next step.</para>
|
---|
[4b93ac2] | 209 |
|
---|
[9dfd852b] | 210 | <para><command>ln -v -sf mysql/libmysqlclient{,_r}.so* .</command>: This
|
---|
[22c7fe6] | 211 | command makes the <application>MySQL</application> shared libraries
|
---|
| 212 | available to other packages at run-time.</para>
|
---|
[08254fc] | 213 |
|
---|
[22c7fe6] | 214 | <para><option>--with-openssl</option>: This switch adds OpenSSL support
|
---|
| 215 | to <application>MySQL</application>.</para>
|
---|
[867e611] | 216 |
|
---|
[9dfd852b] | 217 | <para><option>--with-libwrap</option>: This switch adds tcpwrappers
|
---|
[9b603d4] | 218 | support to <application>MySQL</application>.</para>
|
---|
[9dfd852b] | 219 |
|
---|
[22c7fe6] | 220 | </sect2>
|
---|
[08254fc] | 221 |
|
---|
[22c7fe6] | 222 | <sect2 role="configuration">
|
---|
| 223 | <title>Configuring MySQL</title>
|
---|
[08254fc] | 224 |
|
---|
[22c7fe6] | 225 | <sect3 id="mysql-config">
|
---|
| 226 | <title>Config Files</title>
|
---|
[08254fc] | 227 |
|
---|
[22c7fe6] | 228 | <para><filename>/etc/my.cnf</filename> and
|
---|
| 229 | <filename>~/.my.cnf</filename></para>
|
---|
[08254fc] | 230 |
|
---|
[22c7fe6] | 231 | <indexterm zone="mysql mysql-config">
|
---|
| 232 | <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
|
---|
| 233 | </indexterm>
|
---|
[08254fc] | 234 |
|
---|
[22c7fe6] | 235 | <indexterm zone="mysql mysql-config">
|
---|
| 236 | <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
|
---|
| 237 | </indexterm>
|
---|
[08254fc] | 238 |
|
---|
[22c7fe6] | 239 | </sect3>
|
---|
[08254fc] | 240 |
|
---|
[22c7fe6] | 241 | <sect3>
|
---|
| 242 | <title>Configuration Information</title>
|
---|
[08254fc] | 243 |
|
---|
[22c7fe6] | 244 | <para>There are several default configuration files available in
|
---|
| 245 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
| 246 | use. Create <filename>/etc/my.cnf</filename> using the following command
|
---|
| 247 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[08254fc] | 248 |
|
---|
[22c7fe6] | 249 | <screen role="root"><userinput>install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf</userinput></screen>
|
---|
[08254fc] | 250 |
|
---|
[22c7fe6] | 251 | <para>You can now install a database and change the ownership to the
|
---|
| 252 | unprivileged user and group (perform as the <systemitem
|
---|
| 253 | class="username">root</systemitem> user):</para>
|
---|
[08254fc] | 254 |
|
---|
[22c7fe6] | 255 | <screen role="root"><userinput>mysql_install_db --user=mysql &&
|
---|
| 256 | chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
|
---|
[08254fc] | 257 |
|
---|
[22c7fe6] | 258 | <para>Further configuration requires that the
|
---|
[9dfd852b] | 259 | <application>MySQL</application> server is running. Start
|
---|
[22c7fe6] | 260 | the server using the following commands as the <systemitem
|
---|
| 261 | class="username">root</systemitem> user:</para>
|
---|
[08254fc] | 262 |
|
---|
[515209b3] | 263 | <screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &&
|
---|
[22c7fe6] | 264 | mysqld_safe --user=mysql 2>&1 >/dev/null &</userinput></screen>
|
---|
[08254fc] | 265 |
|
---|
[9dfd852b] | 266 | <para>A default installation does not set up a password for the
|
---|
[22c7fe6] | 267 | administrator, so use the following command as the <systemitem
|
---|
| 268 | class="username">root</systemitem> user to set one. Replace
|
---|
[3cb0c57] | 269 | <replaceable><new-password></replaceable> with your own.</para>
|
---|
[08254fc] | 270 |
|
---|
[3cb0c57] | 271 | <screen role="root"><userinput>mysqladmin -u root password <replaceable><new-password></replaceable></userinput></screen>
|
---|
[08254fc] | 272 |
|
---|
[22c7fe6] | 273 | <para>Configuration of the server is now finished. Shut the server
|
---|
| 274 | down using the following command as the <systemitem
|
---|
| 275 | class="username">root</systemitem> user:</para>
|
---|
[4b93ac2] | 276 |
|
---|
[22c7fe6] | 277 | <screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
|
---|
[08254fc] | 278 |
|
---|
[22c7fe6] | 279 | </sect3>
|
---|
[08254fc] | 280 |
|
---|
[22c7fe6] | 281 | <sect3 id="mysql-init">
|
---|
| 282 | <title>Boot Script</title>
|
---|
[08254fc] | 283 |
|
---|
[22c7fe6] | 284 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
|
---|
[5254d12] | 285 | included in the <xref linkend="bootscripts"/> package as
|
---|
[22c7fe6] | 286 | the <systemitem class="username">root</systemitem> user to start the
|
---|
| 287 | <application>MySQL</application> server during system boot-up.</para>
|
---|
[08254fc] | 288 |
|
---|
[22c7fe6] | 289 | <indexterm zone="mysql mysql-init">
|
---|
| 290 | <primary sortas="f-mysql">mysql</primary>
|
---|
| 291 | </indexterm>
|
---|
[20f5e71a] | 292 |
|
---|
[22c7fe6] | 293 | <screen role="root"><userinput>make install-mysql</userinput></screen>
|
---|
[20f5e71a] | 294 |
|
---|
[22c7fe6] | 295 | </sect3>
|
---|
[08254fc] | 296 |
|
---|
[22c7fe6] | 297 | </sect2>
|
---|
[08254fc] | 298 |
|
---|
[22c7fe6] | 299 | <sect2 role="content">
|
---|
| 300 | <title>Contents</title>
|
---|
| 301 |
|
---|
| 302 | <segmentedlist>
|
---|
| 303 | <segtitle>Installed Programs</segtitle>
|
---|
| 304 | <segtitle>Installed Libraries</segtitle>
|
---|
| 305 | <segtitle>Installed Directories</segtitle>
|
---|
| 306 |
|
---|
| 307 | <seglistitem>
|
---|
[9dfd852b] | 308 | <seg>comp_err, innochecksum, msql2mysql, my_print_defaults,
|
---|
| 309 | myisam_ftdump, myisamchk, myisamlog, myisampack, mysql,
|
---|
| 310 | mysql_client_test, mysql_config, mysql_convert_table_format,
|
---|
| 311 | mysql_create_system_tables, mysql_explain_log, mysql_find_rows,
|
---|
| 312 | mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db,
|
---|
| 313 | mysql_secure_installation, mysql_setpermission, mysql_tableinfo,
|
---|
| 314 | mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin,
|
---|
| 315 | mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe,
|
---|
| 316 | mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager,
|
---|
| 317 | mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen,
|
---|
| 318 | mysqltestmanagerc, perror, replace, resolve_stack_dump, and
|
---|
| 319 | resolveip</seg>
|
---|
| 320 | <seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
|
---|
[3cb0c57] | 321 | libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
|
---|
[9dfd852b] | 322 | libmysys.a, and libvio.a</seg>
|
---|
[22c7fe6] | 323 | <seg>/srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql, and
|
---|
| 324 | /var/run/mysql</seg>
|
---|
| 325 | </seglistitem>
|
---|
| 326 | </segmentedlist>
|
---|
| 327 |
|
---|
| 328 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 329 |
|
---|
| 330 | <para>Descriptions of all the programs and libraries would be several
|
---|
[9dfd852b] | 331 | pages long. Instead, consult the <filename>mysql.info</filename>
|
---|
| 332 | documentation or the on-line reference manual at <ulink
|
---|
| 333 | url="http://dev.mysql.com/doc/refman/5.0/en/index.html"/>.</para>
|
---|
[22c7fe6] | 334 |
|
---|
[9dfd852b] | 335 | <para>The <application>Perl</application> DBI modules must be installed
|
---|
| 336 | for some of the <application>MySQL</application> support programs to
|
---|
| 337 | function properly.</para>
|
---|
[22c7fe6] | 338 |
|
---|
| 339 | </sect2>
|
---|
[f45b1953] | 340 |
|
---|
| 341 | </sect1>
|
---|