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