[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[08254fc] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
[68196987] | 6 |
|
---|
[d0151ee] | 7 | <!-- <!ENTITY mysql-download-http "http://mysql.mirrors.hoobly.com/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz">
|
---|
| 8 | <!ENTITY mysql-download-ftp "ftp://ftp.fu-berlin.de/unix/databases/mysql/Downloads/MySQL-5.0/mysql-&mysql-version;.tar.gz"> -->
|
---|
| 9 | <!ENTITY mysql-download-http "&sources-anduin-http;/m/mysql-&mysql-version;.tar.gz">
|
---|
| 10 | <!ENTITY mysql-download-ftp "&sources-anduin-ftp;/m/mysql-&mysql-version;.tar.gz">
|
---|
[d939eba] | 11 | <!ENTITY mysql-md5sum "b644b219e130b7c6bca81948f75d72d7">
|
---|
| 12 | <!ENTITY mysql-size "21 MB">
|
---|
| 13 | <!ENTITY mysql-buildsize "419 MB (additional 250 MB to run the test suite)">
|
---|
| 14 | <!ENTITY mysql-time "4.7 SBU (Test suite is an additional 61 minutes, only partially CPU dependent)">
|
---|
[08254fc] | 15 | ]>
|
---|
| 16 |
|
---|
[c30b739] | 17 | <sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
|
---|
[22c7fe6] | 18 | <?dbhtml filename="mysql.html"?>
|
---|
| 19 |
|
---|
| 20 | <sect1info>
|
---|
| 21 | <othername>$LastChangedBy$</othername>
|
---|
| 22 | <date>$Date$</date>
|
---|
| 23 | </sect1info>
|
---|
| 24 |
|
---|
| 25 | <title>MySQL-&mysql-version;</title>
|
---|
| 26 |
|
---|
| 27 | <indexterm zone="mysql">
|
---|
| 28 | <primary sortas="a-MySQL">MySQL</primary>
|
---|
| 29 | </indexterm>
|
---|
| 30 |
|
---|
| 31 | <sect2 role="package">
|
---|
| 32 | <title>Introduction to MySQL</title>
|
---|
| 33 |
|
---|
| 34 | <para><application>MySQL</application> is a widely used and fast SQL
|
---|
| 35 | database server. It is a client/server implementation that consists of a
|
---|
| 36 | server daemon and many different client programs and libraries.</para>
|
---|
| 37 |
|
---|
[d0151ee] | 38 | <para>There may be a more recent release available from the
|
---|
| 39 | <application>MySQL</application> home page. You can check
|
---|
| 40 | <ulink url="http://dev.mysql.com/"/> and probably use the
|
---|
| 41 | existing BLFS instructions. Note that versions other than the one shown
|
---|
| 42 | in the download URLs have not been tested in a BLFS environment.</para>
|
---|
| 43 |
|
---|
[22c7fe6] | 44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download (HTTP): <ulink url="&mysql-download-http;"/></para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download MD5 sum: &mysql-md5sum;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download size: &mysql-size;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Estimated disk space required: &mysql-buildsize;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated build time: &mysql-time;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | </itemizedlist>
|
---|
| 65 |
|
---|
[9c98f0e] | 66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 67 | <itemizedlist spacing="compact">
|
---|
| 68 | <listitem>
|
---|
[a41f643] | 69 | <para>Required Patches:
|
---|
[d939eba] | 70 | <ulink url="&patch-root;/mysql-&mysql-version;-logevent-1.patch"/>
|
---|
| 71 | <ulink url="&patch-root;/mysql-&mysql-version;-client-1.patch"/>
|
---|
| 72 | </para>
|
---|
[9c98f0e] | 73 | </listitem>
|
---|
| 74 | </itemizedlist>
|
---|
| 75 |
|
---|
| 76 |
|
---|
[1e11f8e] | 77 | <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
|
---|
[22c7fe6] | 78 |
|
---|
| 79 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[9b603d4] | 80 | <para role="optional"><xref linkend="openssl"/> and
|
---|
[039736d2] | 81 | <xref linkend="tcpwrappers"/>
|
---|
[9f12e36] | 82 |
|
---|
[9b603d4] | 83 | <!-- Removing libedit because it causes more problems than it solves.
|
---|
[9f12e36] | 84 |
|
---|
[22c7fe6] | 85 | <ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
|
---|
[9b603d4] | 86 | (as an alternative to readline)-->
|
---|
[9f12e36] | 87 |
|
---|
[9b603d4] | 88 | </para>
|
---|
[9dfd852b] | 89 |
|
---|
[3cb0c57] | 90 | <para condition="html" role="usernotes">User Notes:
|
---|
| 91 | <ulink url="&blfs-wiki;/mysql"/></para>
|
---|
| 92 |
|
---|
[22c7fe6] | 93 | </sect2>
|
---|
| 94 |
|
---|
| 95 | <sect2 role="installation">
|
---|
| 96 | <title>Installation of MySQL</title>
|
---|
| 97 |
|
---|
| 98 | <para>For security reasons, running the server as an unprivileged user
|
---|
| 99 | and group is strongly encouraged:</para>
|
---|
| 100 |
|
---|
[b785ab29] | 101 | <screen role="root"><userinput>groupadd -g 40 mysql &&
|
---|
| 102 | useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false \
|
---|
| 103 | -u 40 mysql</userinput></screen>
|
---|
[22c7fe6] | 104 |
|
---|
[9c98f0e] | 105 | <note><para>There are a great many options available to
|
---|
| 106 | <userinput>./configure</userinput>. Check the output of the
|
---|
| 107 | <option>--help</option> option for additional customization
|
---|
| 108 | options.</para></note>
|
---|
| 109 |
|
---|
[22c7fe6] | 110 | <para>Build and install <application>MySQL</application> by
|
---|
| 111 | running the following commands:</para>
|
---|
| 112 |
|
---|
[d939eba] | 113 | <screen><userinput>patch -Np1 -i ../mysql-&mysql-version;-logevent-1.patch &&
|
---|
| 114 | patch -Np1 -i ../mysql-&mysql-version;-client-1.patch &&
|
---|
[9b603d4] | 115 | ./configure --prefix=/usr \
|
---|
[9dfd852b] | 116 | --sysconfdir=/etc \
|
---|
| 117 | --libexecdir=/usr/sbin \
|
---|
| 118 | --localstatedir=/srv/mysql \
|
---|
| 119 | --enable-thread-safe-client \
|
---|
| 120 | --enable-assembler \
|
---|
| 121 | --enable-local-infile \
|
---|
| 122 | --with-unix-socket-path=/var/run/mysql/mysql.sock \
|
---|
| 123 | --without-debug \
|
---|
[9b603d4] | 124 | --without-readline \
|
---|
[9c98f0e] | 125 | --with-plugins=innobase,myisam \
|
---|
| 126 | --with-extra-charsets=all \
|
---|
| 127 | --with-ssl &&
|
---|
| 128 | make</userinput></screen>
|
---|
[68196987] | 129 |
|
---|
[d939eba] | 130 | <para>To test the results, issue: <command>make test-force 2>&1 | tee
|
---|
| 131 | test.log</command>. This forces the test to run to completion and logs all
|
---|
| 132 | the test output. There will be many tests that are not run due to
|
---|
| 133 | configuration options and developer considerations. Note that if you have
|
---|
| 134 | a restrictive <filename>/etc/hosts.deny</filename> file, you will need to
|
---|
| 135 | add an appropriate entry to the <filename>/etc/hosts.allow</filename> file
|
---|
| 136 | for the <command>mysqld</command> daemon. Otherwise many of the tests will
|
---|
| 137 | fail.</para>
|
---|
[9e69cae] | 138 |
|
---|
[22c7fe6] | 139 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[20f5e71a] | 140 |
|
---|
[9c98f0e] | 141 | <screen role="root"><userinput>make benchdir_root=/tmp/mysql-bench install &&
|
---|
[9dfd852b] | 142 | rm -rf /tmp/mysql &&
|
---|
[9ad2f59] | 143 | pushd /usr/lib &&
|
---|
| 144 | ln -v -sf mysql/libmysqlclient{,_r}.so* . &&
|
---|
| 145 | popd &&
|
---|
[a41f643] | 146 |
|
---|
[9ad2f59] | 147 | pushd /usr/share/info &&
|
---|
| 148 | rm -v dir &&
|
---|
| 149 | for FILENAME in *; do
|
---|
| 150 | install-info $FILENAME dir 2>/dev/null
|
---|
| 151 | done &&
|
---|
| 152 | popd</userinput></screen>
|
---|
[4b93ac2] | 153 |
|
---|
[039736d2] | 154 | <tip>
|
---|
| 155 | <para>The only documentation shipped in the source tarball are
|
---|
[d939eba] | 156 | <filename>mysql.info</filename>, <filename>manual.chm</filename>
|
---|
[a41f643] | 157 | (Microsoft Help format) files, and man pages. You can download various
|
---|
| 158 | formats of the <application>MySQL</application> Reference Manual
|
---|
[d939eba] | 159 | from <ulink url="http://dev.mysql.com/doc/"/>.</para>
|
---|
[039736d2] | 160 | </tip>
|
---|
[36769b3] | 161 |
|
---|
[22c7fe6] | 162 | </sect2>
|
---|
[4b93ac2] | 163 |
|
---|
[22c7fe6] | 164 | <sect2 role="commands">
|
---|
| 165 | <title>Command Explanations</title>
|
---|
[08254fc] | 166 |
|
---|
[22c7fe6] | 167 | <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs
|
---|
[9dfd852b] | 168 | the <command>mysqld</command> daemon and the
|
---|
| 169 | <command>mysqlmanager</command> program in an appropriate location.</para>
|
---|
[08254fc] | 170 |
|
---|
[22c7fe6] | 171 | <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch
|
---|
| 172 | forces <application>MySQL</application> to use
|
---|
| 173 | <filename class='directory'>/srv/mysql</filename> for database files and
|
---|
| 174 | other variable data.</para>
|
---|
[4b93ac2] | 175 |
|
---|
[22c7fe6] | 176 | <para><parameter>--enable-thread-safe-client</parameter>: This
|
---|
| 177 | switch compiles a thread-safe <application>MySQL</application> client
|
---|
| 178 | library.</para>
|
---|
[4b93ac2] | 179 |
|
---|
[22c7fe6] | 180 | <para><parameter>--enable-assembler</parameter>: This switch allows using
|
---|
| 181 | assembler versions of some string functions.</para>
|
---|
[4b93ac2] | 182 |
|
---|
[22c7fe6] | 183 | <para><parameter>--enable-local-infile</parameter>: This switch enables
|
---|
| 184 | the <quote>LOAD DATA INFILE</quote> SQL statement.</para>
|
---|
[4b93ac2] | 185 |
|
---|
[22c7fe6] | 186 | <para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
|
---|
[db9754e] | 187 | This switch puts the unix-domain socket into the
|
---|
| 188 | <filename class="directory">/var/run/mysql</filename> directory instead of
|
---|
| 189 | the default <filename class="directory">/tmp</filename>.</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-extra-charsets=all</parameter>: This switch enables
|
---|
[9b603d4] | 196 | international character sets within the suite.</para>
|
---|
| 197 |
|
---|
[9c98f0e] | 198 | <para><parameter>--with-plugins=innobase,myisam</parameter>: This switch enables
|
---|
| 199 | two useful table types. Check <command>./configure --help</command> for
|
---|
| 200 | other table types.</para>
|
---|
| 201 |
|
---|
[6a07e73] | 202 | <para><parameter>--with-ssl</parameter>: This switch enables encrypted
|
---|
| 203 | communication between client and server.</para>
|
---|
| 204 |
|
---|
[9c98f0e] | 205 | <para><command>make benchdir_root=...</command>: This installs the benchmark
|
---|
| 206 | and test suites in a non-system location.</para>
|
---|
[4b93ac2] | 207 |
|
---|
[9dfd852b] | 208 | <para><command>ln -v -sf mysql/libmysqlclient{,_r}.so* .</command>: This
|
---|
[22c7fe6] | 209 | command makes the <application>MySQL</application> shared libraries
|
---|
| 210 | available to other packages at run-time.</para>
|
---|
[08254fc] | 211 |
|
---|
[22c7fe6] | 212 | <para><option>--with-openssl</option>: This switch adds OpenSSL support
|
---|
| 213 | to <application>MySQL</application>.</para>
|
---|
[867e611] | 214 |
|
---|
[9dfd852b] | 215 | <para><option>--with-libwrap</option>: This switch adds tcpwrappers
|
---|
[9b603d4] | 216 | support to <application>MySQL</application>.</para>
|
---|
[9dfd852b] | 217 |
|
---|
[9ad2f59] | 218 | <para><command>pushd ... popd</command>: This set of commands rebuilds the
|
---|
| 219 | <filename>/usr/share/info/dir</filename> file as the installation failed
|
---|
| 220 | to do so.</para>
|
---|
| 221 |
|
---|
[22c7fe6] | 222 | </sect2>
|
---|
[08254fc] | 223 |
|
---|
[22c7fe6] | 224 | <sect2 role="configuration">
|
---|
| 225 | <title>Configuring MySQL</title>
|
---|
[08254fc] | 226 |
|
---|
[22c7fe6] | 227 | <sect3 id="mysql-config">
|
---|
| 228 | <title>Config Files</title>
|
---|
[08254fc] | 229 |
|
---|
[22c7fe6] | 230 | <para><filename>/etc/my.cnf</filename> and
|
---|
| 231 | <filename>~/.my.cnf</filename></para>
|
---|
[08254fc] | 232 |
|
---|
[22c7fe6] | 233 | <indexterm zone="mysql mysql-config">
|
---|
| 234 | <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
|
---|
| 235 | </indexterm>
|
---|
[08254fc] | 236 |
|
---|
[22c7fe6] | 237 | <indexterm zone="mysql mysql-config">
|
---|
| 238 | <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
|
---|
| 239 | </indexterm>
|
---|
[08254fc] | 240 |
|
---|
[22c7fe6] | 241 | </sect3>
|
---|
[08254fc] | 242 |
|
---|
[22c7fe6] | 243 | <sect3>
|
---|
| 244 | <title>Configuration Information</title>
|
---|
[08254fc] | 245 |
|
---|
[22c7fe6] | 246 | <para>There are several default configuration files available in
|
---|
| 247 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
| 248 | use. Create <filename>/etc/my.cnf</filename> using the following command
|
---|
| 249 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[08254fc] | 250 |
|
---|
[9c98f0e] | 251 | <screen role="root"><userinput>install -v -m644 /usr/share/mysql/my-medium.cnf /etc/my.cnf
|
---|
| 252 | sed -i -e s/^skip-federated/#skip-federated/ /etc/my.cnf</userinput></screen>
|
---|
| 253 |
|
---|
| 254 | <para>The change to <filename>/etc/my.cnf</filename> can be omitted if the
|
---|
| 255 | option <option>--with-plugins=federated</option> is used.</para>
|
---|
[08254fc] | 256 |
|
---|
[22c7fe6] | 257 | <para>You can now install a database and change the ownership to the
|
---|
| 258 | unprivileged user and group (perform as the <systemitem
|
---|
| 259 | class="username">root</systemitem> user):</para>
|
---|
[08254fc] | 260 |
|
---|
[22c7fe6] | 261 | <screen role="root"><userinput>mysql_install_db --user=mysql &&
|
---|
| 262 | chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
|
---|
[08254fc] | 263 |
|
---|
[22c7fe6] | 264 | <para>Further configuration requires that the
|
---|
[9dfd852b] | 265 | <application>MySQL</application> server is running. Start
|
---|
[22c7fe6] | 266 | the server using the following commands as the <systemitem
|
---|
| 267 | class="username">root</systemitem> user:</para>
|
---|
[08254fc] | 268 |
|
---|
[515209b3] | 269 | <screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &&
|
---|
[22c7fe6] | 270 | mysqld_safe --user=mysql 2>&1 >/dev/null &</userinput></screen>
|
---|
[08254fc] | 271 |
|
---|
[9dfd852b] | 272 | <para>A default installation does not set up a password for the
|
---|
[22c7fe6] | 273 | administrator, so use the following command as the <systemitem
|
---|
| 274 | class="username">root</systemitem> user to set one. Replace
|
---|
[3cb0c57] | 275 | <replaceable><new-password></replaceable> with your own.</para>
|
---|
[08254fc] | 276 |
|
---|
[3cb0c57] | 277 | <screen role="root"><userinput>mysqladmin -u root password <replaceable><new-password></replaceable></userinput></screen>
|
---|
[08254fc] | 278 |
|
---|
[22c7fe6] | 279 | <para>Configuration of the server is now finished. Shut the server
|
---|
| 280 | down using the following command as the <systemitem
|
---|
| 281 | class="username">root</systemitem> user:</para>
|
---|
[4b93ac2] | 282 |
|
---|
[22c7fe6] | 283 | <screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
|
---|
[08254fc] | 284 |
|
---|
[22c7fe6] | 285 | </sect3>
|
---|
[08254fc] | 286 |
|
---|
[22c7fe6] | 287 | <sect3 id="mysql-init">
|
---|
| 288 | <title>Boot Script</title>
|
---|
[08254fc] | 289 |
|
---|
[22c7fe6] | 290 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
|
---|
[5254d12] | 291 | included in the <xref linkend="bootscripts"/> package as
|
---|
[22c7fe6] | 292 | the <systemitem class="username">root</systemitem> user to start the
|
---|
| 293 | <application>MySQL</application> server during system boot-up.</para>
|
---|
[08254fc] | 294 |
|
---|
[22c7fe6] | 295 | <indexterm zone="mysql mysql-init">
|
---|
| 296 | <primary sortas="f-mysql">mysql</primary>
|
---|
| 297 | </indexterm>
|
---|
[20f5e71a] | 298 |
|
---|
[22c7fe6] | 299 | <screen role="root"><userinput>make install-mysql</userinput></screen>
|
---|
[20f5e71a] | 300 |
|
---|
[22c7fe6] | 301 | </sect3>
|
---|
[08254fc] | 302 |
|
---|
[22c7fe6] | 303 | </sect2>
|
---|
[08254fc] | 304 |
|
---|
[22c7fe6] | 305 | <sect2 role="content">
|
---|
| 306 | <title>Contents</title>
|
---|
| 307 |
|
---|
| 308 | <segmentedlist>
|
---|
| 309 | <segtitle>Installed Programs</segtitle>
|
---|
| 310 | <segtitle>Installed Libraries</segtitle>
|
---|
| 311 | <segtitle>Installed Directories</segtitle>
|
---|
| 312 |
|
---|
| 313 | <seglistitem>
|
---|
[9dfd852b] | 314 | <seg>comp_err, innochecksum, msql2mysql, my_print_defaults,
|
---|
| 315 | myisam_ftdump, myisamchk, myisamlog, myisampack, mysql,
|
---|
| 316 | mysql_client_test, mysql_config, mysql_convert_table_format,
|
---|
| 317 | mysql_create_system_tables, mysql_explain_log, mysql_find_rows,
|
---|
| 318 | mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db,
|
---|
| 319 | mysql_secure_installation, mysql_setpermission, mysql_tableinfo,
|
---|
| 320 | mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin,
|
---|
| 321 | mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe,
|
---|
| 322 | mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager,
|
---|
| 323 | mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen,
|
---|
| 324 | mysqltestmanagerc, perror, replace, resolve_stack_dump, and
|
---|
| 325 | resolveip</seg>
|
---|
| 326 | <seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
|
---|
[3cb0c57] | 327 | libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
|
---|
[9dfd852b] | 328 | libmysys.a, and libvio.a</seg>
|
---|
[22c7fe6] | 329 | <seg>/srv/mysql, /usr/include/mysql, /usr/lib/mysql, /usr/share/mysql, and
|
---|
| 330 | /var/run/mysql</seg>
|
---|
| 331 | </seglistitem>
|
---|
| 332 | </segmentedlist>
|
---|
| 333 |
|
---|
| 334 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 335 |
|
---|
| 336 | <para>Descriptions of all the programs and libraries would be several
|
---|
[9dfd852b] | 337 | pages long. Instead, consult the <filename>mysql.info</filename>
|
---|
| 338 | documentation or the on-line reference manual at <ulink
|
---|
| 339 | url="http://dev.mysql.com/doc/refman/5.0/en/index.html"/>.</para>
|
---|
[22c7fe6] | 340 |
|
---|
[9dfd852b] | 341 | <para>The <application>Perl</application> DBI modules must be installed
|
---|
| 342 | for some of the <application>MySQL</application> support programs to
|
---|
| 343 | function properly.</para>
|
---|
[22c7fe6] | 344 |
|
---|
| 345 | </sect2>
|
---|
[f45b1953] | 346 |
|
---|
| 347 | </sect1>
|
---|