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