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