[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 "&sources-anduin-http;/m/mysql-&mysql-version;.tar.gz">
|
---|
| 8 | <!ENTITY mysql-download-ftp "&sources-anduin-ftp;/m/mysql-&mysql-version;.tar.gz">
|
---|
[16e74d3] | 9 | <!ENTITY mysql-md5sum "dcb6a06e68c5e8f30f57b15300730c9c">
|
---|
| 10 | <!ENTITY mysql-size "23 MB">
|
---|
| 11 | <!ENTITY mysql-buildsize "883 MB (additional 170 MB to run the test suite)">
|
---|
| 12 | <!ENTITY mysql-time "3.9 SBU (Test suite is an additional 45 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 |
|
---|
[d0151ee] | 36 | <para>There may be a more recent release available from the
|
---|
| 37 | <application>MySQL</application> home page. You can check
|
---|
| 38 | <ulink url="http://dev.mysql.com/"/> and probably use the
|
---|
| 39 | existing BLFS instructions. Note that versions other than the one shown
|
---|
| 40 | in the download URLs have not been tested in a BLFS environment.</para>
|
---|
| 41 |
|
---|
[b88be39] | 42 | &lfs70_checked;
|
---|
[fa050c09] | 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 |
|
---|
[47a345a2] | 66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[9c98f0e] | 67 | <itemizedlist spacing="compact">
|
---|
[7ea2a6f] | 68 | <listitem>
|
---|
| 69 | <para>Optional patch: <ulink
|
---|
| 70 | url="&patch-root;/mysql-&mysql-version;-embedded-library-shared-1.patch"/></para>
|
---|
| 71 | </listitem>
|
---|
[47a345a2] | 72 | <listitem>
|
---|
| 73 | <para>Optional Documentation (see tip below):
|
---|
| 74 | <ulink url="http://dev.mysql.com/doc/"/>
|
---|
[f267149] | 75 | </para>
|
---|
[9c98f0e] | 76 | </listitem>
|
---|
| 77 | </itemizedlist>
|
---|
| 78 |
|
---|
[7ea2a6f] | 79 | <note><para>The patch is required only if you plan to install <application>
|
---|
[b9569f37] | 80 | Amarok</application>.</para></note>
|
---|
[7ea2a6f] | 81 |
|
---|
[1e11f8e] | 82 | <bridgehead renderas="sect3">MySQL Dependencies</bridgehead>
|
---|
[22c7fe6] | 83 |
|
---|
[16e74d3] | 84 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 85 | <para role="optional"><xref linkend="cmake"/></para>
|
---|
| 86 |
|
---|
[f267149] | 87 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 88 | <para role="optional"><xref linkend="openssl"/></para>
|
---|
| 89 |
|
---|
[22c7fe6] | 90 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[b9569f37] | 91 | <para role="optional"><xref linkend="tcpwrappers"/> and
|
---|
[16e74d3] | 92 | <ulink url="http://packages.debian.org/squeeze/libaio-dev">libaio</ulink></para>
|
---|
[9f12e36] | 93 |
|
---|
[3cb0c57] | 94 | <para condition="html" role="usernotes">User Notes:
|
---|
| 95 | <ulink url="&blfs-wiki;/mysql"/></para>
|
---|
| 96 |
|
---|
[22c7fe6] | 97 | </sect2>
|
---|
| 98 |
|
---|
| 99 | <sect2 role="installation">
|
---|
| 100 | <title>Installation of MySQL</title>
|
---|
| 101 |
|
---|
| 102 | <para>For security reasons, running the server as an unprivileged user
|
---|
| 103 | and group is strongly encouraged:</para>
|
---|
| 104 |
|
---|
[b785ab29] | 105 | <screen role="root"><userinput>groupadd -g 40 mysql &&
|
---|
[b88be39] | 106 | useradd -c "MySQL Server" -d /dev/null -g mysql -s /bin/false -u 40 mysql</userinput></screen>
|
---|
[22c7fe6] | 107 |
|
---|
[9c98f0e] | 108 | <note><para>There are a great many options available to
|
---|
[16e74d3] | 109 | <userinput>cmake</userinput>. Check the output of the `<userinput>cmake .
|
---|
| 110 | -LH</userinput>` for additional customization options. See ithe <ulink
|
---|
| 111 | url="http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html">MySQL
|
---|
| 112 | Documentation</ulink> for a full listing of all options.</para></note>
|
---|
[9c98f0e] | 113 |
|
---|
[b9569f37] | 114 | <note><para>If you plan to install <application>Amarok</application>, you need to
|
---|
[7ea2a6f] | 115 | apply the optional patch, add the cmake option
|
---|
| 116 | <userinput>-DWITH_EMBEDDED_SERVER=ON</userinput> and add
|
---|
| 117 | <userinput>Embedded</userinput> to the <userinput>SEGMENTS</userinput> variable
|
---|
| 118 | below.</para></note>
|
---|
| 119 |
|
---|
| 120 | <para>Apply the optional patch:</para>
|
---|
| 121 |
|
---|
| 122 | <screen><userinput>patch -Np1 -i ../mysql-&mysql-version;-embedded-library-shared-1.patch</userinput></screen>
|
---|
| 123 |
|
---|
[22c7fe6] | 124 | <para>Build and install <application>MySQL</application> by
|
---|
| 125 | running the following commands:</para>
|
---|
[7ea2a6f] | 126 |
|
---|
[16e74d3] | 127 | <screen><userinput>cmake . \
|
---|
| 128 | -DSYSCONFDIR=/etc \
|
---|
| 129 | -DMYSQL_DATADIR=/srv/mysql \
|
---|
| 130 | -DINSTALL_MYSQLDATADIR=/srv/mysql \
|
---|
| 131 | -DCMAKE_INSTALL_PREFIX=/usr \
|
---|
| 132 | -DINSTALL_BINDIR=bin \
|
---|
| 133 | -DINSTALL_SBINDIR=sbin \
|
---|
| 134 | -DINSTALL_DOCDIR=share/doc/mysql \
|
---|
| 135 | -DINSTALL_DOCREADMEDIR=share/doc/mysql \
|
---|
| 136 | -DINSTALL_INCLUDEDIR=include/mysql \
|
---|
| 137 | -DINSTALL_INFODIR=share/info \
|
---|
| 138 | -DINSTALL_LIBDIR=lib \
|
---|
| 139 | -DINSTALL_MANDIR=share/man \
|
---|
| 140 | -DINSTALL_MYSQLSHAREDIR=share/mysql \
|
---|
| 141 | -DINSTALL_MYSQLTESTDIR=share/mysql-test \
|
---|
| 142 | -DINSTALL_PLUGINDIR=lib/plugin \
|
---|
| 143 | -DINSTALL_SCRIPTDIR=bin \
|
---|
| 144 | -DINSTALL_SHAREDIR=share/mysql \
|
---|
| 145 | -DINSTALL_SQLBENCHDIR=share/mysql-bench \
|
---|
| 146 | -DINSTALL_SUPPORTFILESDIR=share/mysql/support-files \
|
---|
| 147 | -DWITH_ZLIB=system \
|
---|
| 148 | -DWITH_SSL=system \
|
---|
| 149 | -DWITH_READLINE=system \
|
---|
| 150 | -DMYSQL_UNIX_ADDR=/var/run/mysql/mysql.sock \
|
---|
| 151 | -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
|
---|
| 152 | -DWITH_FEDERATED_STORAGE_ENGINE=1 \
|
---|
| 153 | -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
|
---|
| 154 | -DMYSQL_MAINTAINER_MODE=OFF \
|
---|
| 155 | -DWITH_DEBUG=OFF &&
|
---|
[9c98f0e] | 156 | make</userinput></screen>
|
---|
[68196987] | 157 |
|
---|
[d939eba] | 158 | <para>To test the results, issue: <command>make test-force 2>&1 | tee
|
---|
| 159 | test.log</command>. This forces the test to run to completion and logs all
|
---|
| 160 | the test output. There will be many tests that are not run due to
|
---|
[f267149] | 161 | configuration options and developer considerations. Note that if you use
|
---|
| 162 | TCP Wrappers and have a restrictive <filename>/etc/hosts.deny</filename>
|
---|
| 163 | file, you will need to add an appropriate entry to the
|
---|
| 164 | <filename>/etc/hosts.allow</filename> file for the
|
---|
| 165 | <command>mysqld</command> daemon. Otherwise many of the tests will
|
---|
[d939eba] | 166 | fail.</para>
|
---|
[9e69cae] | 167 |
|
---|
[16e74d3] | 168 | <note><para>The ssl tests may fail due to expired certifictes.</para></note>
|
---|
| 169 |
|
---|
[22c7fe6] | 170 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[20f5e71a] | 171 |
|
---|
[b9569f37] | 172 | <screen role="root"><userinput>SEGMENTS="Client Server IniFiles ManPages SharedLibraries"
|
---|
[16e74d3] | 173 | SEGMENTS="$SEGMENTS Development Documentation Info Readme"
|
---|
| 174 |
|
---|
| 175 | for segment in $SEGMENTS; do
|
---|
| 176 | cmake -DCMAKE_INSTALL_COMPONENT=$segment -P cmake_install.cmake
|
---|
| 177 | done
|
---|
[a41f643] | 178 |
|
---|
[16e74d3] | 179 | unset SEGMENTS</userinput></screen>
|
---|
[4b93ac2] | 180 |
|
---|
[039736d2] | 181 | <tip>
|
---|
| 182 | <para>The only documentation shipped in the source tarball are
|
---|
[f267149] | 183 | <filename>mysql.info</filename> and man pages. You can download various
|
---|
[a41f643] | 184 | formats of the <application>MySQL</application> Reference Manual
|
---|
[d939eba] | 185 | from <ulink url="http://dev.mysql.com/doc/"/>.</para>
|
---|
[039736d2] | 186 | </tip>
|
---|
[36769b3] | 187 |
|
---|
[16e74d3] | 188 | <note><para>If you only want to build and install the
|
---|
| 189 | <command>mysql</command> client, use:</para>
|
---|
[4b93ac2] | 190 |
|
---|
[16e74d3] | 191 | <screen><userinput>cmake . &&
|
---|
| 192 | make mysqlclient libmysql</userinput></screen>
|
---|
[867e611] | 193 |
|
---|
[16e74d3] | 194 | <para>Continue as root:</para>
|
---|
[867e611] | 195 |
|
---|
[16e74d3] | 196 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 197 | </note>
|
---|
[9b603d4] | 198 |
|
---|
[16e74d3] | 199 | </sect2>
|
---|
[08254fc] | 200 |
|
---|
[16e74d3] | 201 | <sect2 role="commands">
|
---|
| 202 | <title>Command Explanations</title>
|
---|
[9dfd852b] | 203 |
|
---|
[16e74d3] | 204 | <para><command>cmake -DCMAKE_INSTALL_COMPONENT=$segment ...</command>: This
|
---|
| 205 | command installs the appropriate portion of the package. Different
|
---|
| 206 | segemnts may be added or deleted as desired. Valid segments are listed
|
---|
| 207 | with `<command>make list_install_components</command>`. Note that the
|
---|
| 208 | 'DataFiles' install segment does not honor the -DMYSQL_DATADIR or
|
---|
| 209 | -DINSTALL_MYSQLDATADIR statements.</para>
|
---|
[9ad2f59] | 210 |
|
---|
[22c7fe6] | 211 | </sect2>
|
---|
[08254fc] | 212 |
|
---|
[22c7fe6] | 213 | <sect2 role="configuration">
|
---|
| 214 | <title>Configuring MySQL</title>
|
---|
[08254fc] | 215 |
|
---|
[22c7fe6] | 216 | <sect3 id="mysql-config">
|
---|
| 217 | <title>Config Files</title>
|
---|
[08254fc] | 218 |
|
---|
[22c7fe6] | 219 | <para><filename>/etc/my.cnf</filename> and
|
---|
| 220 | <filename>~/.my.cnf</filename></para>
|
---|
[08254fc] | 221 |
|
---|
[22c7fe6] | 222 | <indexterm zone="mysql mysql-config">
|
---|
| 223 | <primary sortas="e-AA.my.cnf">~/.my.cnf</primary>
|
---|
| 224 | </indexterm>
|
---|
[08254fc] | 225 |
|
---|
[22c7fe6] | 226 | <indexterm zone="mysql mysql-config">
|
---|
| 227 | <primary sortas="e-etc-my.cnf">/etc/my.cnf</primary>
|
---|
| 228 | </indexterm>
|
---|
[08254fc] | 229 |
|
---|
[22c7fe6] | 230 | </sect3>
|
---|
[08254fc] | 231 |
|
---|
[22c7fe6] | 232 | <sect3>
|
---|
| 233 | <title>Configuration Information</title>
|
---|
[08254fc] | 234 |
|
---|
[22c7fe6] | 235 | <para>There are several default configuration files available in
|
---|
| 236 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
| 237 | use. Create <filename>/etc/my.cnf</filename> using the following command
|
---|
| 238 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[08254fc] | 239 |
|
---|
[16e74d3] | 240 | <screen role="root"><userinput>install -v -m644 /usr/share/mysql/support-files/my-medium.cnf /etc/my.cnf</userinput></screen>
|
---|
[08254fc] | 241 |
|
---|
[22c7fe6] | 242 | <para>You can now install a database and change the ownership to the
|
---|
| 243 | unprivileged user and group (perform as the <systemitem
|
---|
| 244 | class="username">root</systemitem> user):</para>
|
---|
[08254fc] | 245 |
|
---|
[16e74d3] | 246 | <screen role="root"><userinput>mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql &&
|
---|
[22c7fe6] | 247 | chgrp -v mysql /srv/mysql{,/test,/mysql}</userinput></screen>
|
---|
[08254fc] | 248 |
|
---|
[22c7fe6] | 249 | <para>Further configuration requires that the
|
---|
[9dfd852b] | 250 | <application>MySQL</application> server is running. Start
|
---|
[22c7fe6] | 251 | the server using the following commands as the <systemitem
|
---|
| 252 | class="username">root</systemitem> user:</para>
|
---|
[08254fc] | 253 |
|
---|
[515209b3] | 254 | <screen role="root"><userinput>install -v -m755 -o mysql -g mysql -d /var/run/mysql &&
|
---|
[22c7fe6] | 255 | mysqld_safe --user=mysql 2>&1 >/dev/null &</userinput></screen>
|
---|
[08254fc] | 256 |
|
---|
[9dfd852b] | 257 | <para>A default installation does not set up a password for the
|
---|
[22c7fe6] | 258 | administrator, so use the following command as the <systemitem
|
---|
| 259 | class="username">root</systemitem> user to set one. Replace
|
---|
[3cb0c57] | 260 | <replaceable><new-password></replaceable> with your own.</para>
|
---|
[08254fc] | 261 |
|
---|
[3cb0c57] | 262 | <screen role="root"><userinput>mysqladmin -u root password <replaceable><new-password></replaceable></userinput></screen>
|
---|
[08254fc] | 263 |
|
---|
[22c7fe6] | 264 | <para>Configuration of the server is now finished. Shut the server
|
---|
| 265 | down using the following command as the <systemitem
|
---|
| 266 | class="username">root</systemitem> user:</para>
|
---|
[4b93ac2] | 267 |
|
---|
[22c7fe6] | 268 | <screen role="root"><userinput>mysqladmin -p shutdown</userinput></screen>
|
---|
[08254fc] | 269 |
|
---|
[22c7fe6] | 270 | </sect3>
|
---|
[08254fc] | 271 |
|
---|
[22c7fe6] | 272 | <sect3 id="mysql-init">
|
---|
| 273 | <title>Boot Script</title>
|
---|
[08254fc] | 274 |
|
---|
[22c7fe6] | 275 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename> init script
|
---|
[5254d12] | 276 | included in the <xref linkend="bootscripts"/> package as
|
---|
[22c7fe6] | 277 | the <systemitem class="username">root</systemitem> user to start the
|
---|
| 278 | <application>MySQL</application> server during system boot-up.</para>
|
---|
[08254fc] | 279 |
|
---|
[22c7fe6] | 280 | <indexterm zone="mysql mysql-init">
|
---|
| 281 | <primary sortas="f-mysql">mysql</primary>
|
---|
| 282 | </indexterm>
|
---|
[20f5e71a] | 283 |
|
---|
[22c7fe6] | 284 | <screen role="root"><userinput>make install-mysql</userinput></screen>
|
---|
[20f5e71a] | 285 |
|
---|
[22c7fe6] | 286 | </sect3>
|
---|
[08254fc] | 287 |
|
---|
[22c7fe6] | 288 | </sect2>
|
---|
[08254fc] | 289 |
|
---|
[22c7fe6] | 290 | <sect2 role="content">
|
---|
| 291 | <title>Contents</title>
|
---|
| 292 |
|
---|
| 293 | <segmentedlist>
|
---|
| 294 | <segtitle>Installed Programs</segtitle>
|
---|
| 295 | <segtitle>Installed Libraries</segtitle>
|
---|
| 296 | <segtitle>Installed Directories</segtitle>
|
---|
| 297 |
|
---|
| 298 | <seglistitem>
|
---|
[9dfd852b] | 299 | <seg>comp_err, innochecksum, msql2mysql, my_print_defaults,
|
---|
| 300 | myisam_ftdump, myisamchk, myisamlog, myisampack, mysql,
|
---|
| 301 | mysql_client_test, mysql_config, mysql_convert_table_format,
|
---|
| 302 | mysql_create_system_tables, mysql_explain_log, mysql_find_rows,
|
---|
| 303 | mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install_db,
|
---|
| 304 | mysql_secure_installation, mysql_setpermission, mysql_tableinfo,
|
---|
| 305 | mysql_tzinfo_to_sql, mysql_waitpid, mysql_zap, mysqlaccess, mysqladmin,
|
---|
| 306 | mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe,
|
---|
| 307 | mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager,
|
---|
| 308 | mysqlshow, mysqltest, mysqltestmanager, mysqltestmanager-pwgen,
|
---|
| 309 | mysqltestmanagerc, perror, replace, resolve_stack_dump, and
|
---|
| 310 | resolveip</seg>
|
---|
| 311 | <seg>libdbug.a, libheap.a, libmyisam.a, libmyisammrg.a,
|
---|
[3cb0c57] | 312 | libmysqlclient.{so,a}, libmysqlclient_r.{so,a}, libmystrings.a,
|
---|
[9dfd852b] | 313 | libmysys.a, and libvio.a</seg>
|
---|
[9b7d496] | 314 | <seg>/srv/mysql, /usr/include/mysql, /usr/lib/plugin, /usr/share/mysql and
|
---|
[22c7fe6] | 315 | /var/run/mysql</seg>
|
---|
| 316 | </seglistitem>
|
---|
| 317 | </segmentedlist>
|
---|
| 318 |
|
---|
| 319 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 320 |
|
---|
| 321 | <para>Descriptions of all the programs and libraries would be several
|
---|
[9dfd852b] | 322 | pages long. Instead, consult the <filename>mysql.info</filename>
|
---|
| 323 | documentation or the on-line reference manual at <ulink
|
---|
[47a345a2] | 324 | url="http://dev.mysql.com/doc/refman/5.1/en/index.html"/>.</para>
|
---|
[22c7fe6] | 325 |
|
---|
[9dfd852b] | 326 | <para>The <application>Perl</application> DBI modules must be installed
|
---|
| 327 | for some of the <application>MySQL</application> support programs to
|
---|
| 328 | function properly.</para>
|
---|
[22c7fe6] | 329 |
|
---|
| 330 | </sect2>
|
---|
[f45b1953] | 331 |
|
---|
| 332 | </sect1>
|
---|