[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[867e611] | 7 | <!ENTITY mysql-download-http "http://mysql.he.net/Downloads/MySQL-4.1/mysql-&mysql-version;.tar.gz">
|
---|
| 8 | <!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.1/mysql-&mysql-version;.tar.gz">
|
---|
[49ef91b1] | 9 | <!ENTITY mysql-md5 "2886edbe5cc826727fbb79a79d41145c">
|
---|
| 10 | <!ENTITY mysql-size "22 MB">
|
---|
[54b4a3e] | 11 | <!ENTITY mysql-buildsize "117 MB">
|
---|
[49ef91b1] | 12 | <!ENTITY mysql-time "4.65 SBU">
|
---|
[08254fc] | 13 | ]>
|
---|
| 14 |
|
---|
[c30b739] | 15 | <sect1 id="mysql" xreflabel="MySQL-&mysql-version;">
|
---|
[a0f03b0] | 16 | <sect1info>
|
---|
[5cd0959d] | 17 | <othername>$LastChangedBy$</othername>
|
---|
| 18 | <date>$Date$</date>
|
---|
[a0f03b0] | 19 | </sect1info>
|
---|
[00bb024c] | 20 | <?dbhtml filename="mysql.html"?>
|
---|
[c30b739] | 21 | <title>MySQL-&mysql-version;</title>
|
---|
[f45b1953] | 22 |
|
---|
[08254fc] | 23 | <sect2>
|
---|
[4b93ac2] | 24 | <title>Introduction to <application>My<acronym>SQL</acronym></application>
|
---|
| 25 | </title>
|
---|
[08254fc] | 26 |
|
---|
[4b93ac2] | 27 | <para><application>My<acronym>SQL</acronym></application> is a widely used and
|
---|
| 28 | fast <acronym>SQL</acronym> database server. It is a client/server
|
---|
[08254fc] | 29 | implementation that consists of a server daemon and many different
|
---|
| 30 | client programs and libraries.</para>
|
---|
| 31 |
|
---|
| 32 | <sect3><title>Package information</title>
|
---|
| 33 | <itemizedlist spacing='compact'>
|
---|
[03d51788] | 34 | <listitem><para>Download (HTTP):
|
---|
| 35 | <ulink url="&mysql-download-http;"/></para></listitem>
|
---|
| 36 | <listitem><para>Download (FTP):
|
---|
| 37 | <ulink url="&mysql-download-ftp;"/></para></listitem>
|
---|
| 38 | <listitem><para>Download MD5 sum: &mysql-md5;</para></listitem>
|
---|
[08254fc] | 39 | <listitem><para>Download size: &mysql-size;</para></listitem>
|
---|
[03d51788] | 40 | <listitem><para>Estimated disk space required:
|
---|
| 41 | &mysql-buildsize;</para></listitem>
|
---|
| 42 | <listitem><para>Estimated build time:
|
---|
| 43 | &mysql-time;</para></listitem></itemizedlist>
|
---|
[08254fc] | 44 | </sect3>
|
---|
| 45 |
|
---|
[4b93ac2] | 46 | <sect3><title><application>My<acronym>SQL</acronym></application> dependencies
|
---|
| 47 | </title>
|
---|
[08254fc] | 48 | <sect4><title>Optional</title>
|
---|
[867e611] | 49 | <para>
|
---|
[939cf0da] | 50 | <xref linkend="openssl-package"/>,
|
---|
[867e611] | 51 | <xref linkend="tcpwrappers"/>,
|
---|
[03d51788] | 52 | <ulink url="http://sourceforge.net/projects/libedit/">libedit</ulink>
|
---|
| 53 | (as an alternative to readline),
|
---|
| 54 | <xref linkend="ORBit"/> (detected only if <xref linkend="which"/> is
|
---|
| 55 | installed),
|
---|
[867e611] | 56 | <xref linkend="doxygen"/> and
|
---|
[03d51788] | 57 | <xref linkend="tex"/>
|
---|
[08254fc] | 58 | </para></sect4>
|
---|
| 59 | </sect3>
|
---|
| 60 |
|
---|
| 61 | </sect2>
|
---|
| 62 |
|
---|
| 63 | <sect2>
|
---|
[4b93ac2] | 64 | <title>Installation of <application>My<acronym>SQL</acronym></application>
|
---|
| 65 | </title>
|
---|
[08254fc] | 66 |
|
---|
| 67 | <para>For security reasons, running the server as an unprivileged user
|
---|
| 68 | and group is strongly encouraged:</para>
|
---|
| 69 |
|
---|
| 70 | <screen><userinput><command>groupadd mysql &&
|
---|
| 71 | useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql</command></userinput></screen>
|
---|
| 72 |
|
---|
[4b93ac2] | 73 | <para>Build and install <application>My<acronym>SQL</acronym></application> by
|
---|
| 74 | running the following commands:</para>
|
---|
[08254fc] | 75 |
|
---|
[c2c2d76] | 76 | <screen><userinput><command>CPPFLAGS="-D_GNU_SOURCE" ./configure --prefix=/usr --sysconfdir=/etc \
|
---|
[4b93ac2] | 77 | --libexecdir=/usr/sbin --localstatedir=/srv/mysql \
|
---|
| 78 | --enable-thread-safe-client --enable-assembler \
|
---|
[867e611] | 79 | --enable-local-infile --with-named-thread-libs=-lpthread \
|
---|
[d0abeb0] | 80 | --with-unix-socket-path=/var/run/mysql/mysql.sock \
|
---|
[ac109439] | 81 | --without-debug --without-bench --without-readline &&
|
---|
[08254fc] | 82 | make testdir=/usr/lib/mysql/mysql-test &&
|
---|
[4b93ac2] | 83 | make testdir=/usr/lib/mysql/mysql-test install &&
|
---|
| 84 | cd /usr/lib &&
|
---|
| 85 | ln -sf mysql/libmysqlclient{,_r}.so* .</command></userinput></screen>
|
---|
| 86 |
|
---|
| 87 | </sect2>
|
---|
| 88 |
|
---|
| 89 | <sect2>
|
---|
| 90 | <title>Command explanations</title>
|
---|
[08254fc] | 91 |
|
---|
[4b93ac2] | 92 | <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs the
|
---|
| 93 | <command>mysqld</command> daemon in an appropriate location.</para>
|
---|
[08254fc] | 94 |
|
---|
[4b93ac2] | 95 | <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch forces
|
---|
| 96 | <application>My<acronym>SQL</acronym></application> to use
|
---|
| 97 | <filename class='directory'>/srv/mysql</filename> for database files and other
|
---|
| 98 | variable data.</para>
|
---|
| 99 |
|
---|
| 100 | <para><parameter>--enable-thread-safe-client</parameter>: This switch compiles a
|
---|
| 101 | thread-safe <application>My<acronym>SQL</acronym></application> client library.
|
---|
| 102 | </para>
|
---|
| 103 |
|
---|
| 104 | <para><parameter>--enable-assembler</parameter>: This switch allows using
|
---|
| 105 | assembler versions of some string functions.</para>
|
---|
| 106 |
|
---|
[867e611] | 107 | <para><parameter>--enable-local-infile</parameter>: This switch enables the
|
---|
[4b93ac2] | 108 | LOAD DATA INFILE <acronym>SQL</acronym> statement.</para>
|
---|
| 109 |
|
---|
[c2c2d76] | 110 | <para><parameter>CPPFLAGS="-D_GNU_SOURCE" --with-named-thread-libs=-lpthread</parameter>:
|
---|
| 111 | This environment variable and configure switch enable building on
|
---|
| 112 | <acronym>NPTL</acronym> systems.</para>
|
---|
| 113 |
|
---|
[867e611] | 114 | <para><parameter>--with-unix-socket-path=/var/run/mysql</parameter>:
|
---|
| 115 | This switch puts the unix-domain socket into <filename
|
---|
| 116 | class="directory">/var/run/mysql</filename> directory instead of default
|
---|
| 117 | <filename class="directory">/tmp</filename>.</para>
|
---|
| 118 |
|
---|
| 119 | <para><parameter>--without-bench</parameter>: This switch skips building the
|
---|
| 120 | benchmark suite.</para>
|
---|
| 121 |
|
---|
| 122 | <para><parameter>--without-readline</parameter>: This switch forces the build
|
---|
| 123 | to use the system copy of <application>readline</application> instead of the
|
---|
| 124 | bundled copy.</para>
|
---|
| 125 |
|
---|
[4b93ac2] | 126 | <para><command>make testdir=...</command>: This installs the test suite in
|
---|
| 127 | <filename class='directory'>/usr/lib/mysql/mysql-test</filename>.
|
---|
| 128 | <acronym>BLFS</acronym> is currently seeking a method to omit the installation
|
---|
| 129 | of the test suite altogether.</para>
|
---|
| 130 |
|
---|
[2fa0880] | 131 | <para><command>ln -sf mysql/libmysqlclient{,_r}.so* .</command>: This command
|
---|
[4b93ac2] | 132 | makes the <application>My<acronym>SQL</acronym></application> shared libraries
|
---|
| 133 | available to other packages at run-time.</para>
|
---|
[08254fc] | 134 |
|
---|
[867e611] | 135 | <para><option>--with-libwrap</option>: This switch adds tcpwrappers
|
---|
| 136 | support to <application>My<acronym>SQL</acronym></application>.</para>
|
---|
| 137 |
|
---|
| 138 | <para><option>--with-openssl</option>: This switch adds OpenSSL support
|
---|
| 139 | to <application>My<acronym>SQL</acronym></application>.</para>
|
---|
| 140 |
|
---|
[08254fc] | 141 | </sect2>
|
---|
| 142 |
|
---|
| 143 | <sect2>
|
---|
| 144 | <title>Configuring <application>My<acronym>SQL</acronym></application></title>
|
---|
| 145 |
|
---|
| 146 | <sect3>
|
---|
| 147 | <title>Config files</title>
|
---|
| 148 |
|
---|
| 149 | <para><filename>/etc/my.cnf</filename>, <filename>~/.my.cnf</filename></para>
|
---|
| 150 |
|
---|
| 151 | </sect3>
|
---|
| 152 |
|
---|
| 153 | <sect3>
|
---|
| 154 | <title>Configuration Information</title>
|
---|
| 155 |
|
---|
| 156 | <para>There are several default configuration files available in
|
---|
| 157 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
| 158 | use. Create <filename>/etc/my.cnf</filename> using the following
|
---|
| 159 | command:</para>
|
---|
| 160 |
|
---|
[49ef91b1] | 161 | <screen><userinput><command>cp /usr/share/mysql/my-medium.cnf /etc/my.cnf</command></userinput></screen>
|
---|
[08254fc] | 162 |
|
---|
| 163 | <para>You can now install a database and change the ownership to the
|
---|
| 164 | unprivileged user and group.</para>
|
---|
| 165 |
|
---|
[ac109439] | 166 | <screen><userinput><command>mysql_install_db --user=mysql</command></userinput></screen>
|
---|
[08254fc] | 167 |
|
---|
[4b93ac2] | 168 | <para>Further configuration requires that the
|
---|
| 169 | <application>My<acronym>SQL</acronym></application> server be running:</para>
|
---|
[08254fc] | 170 |
|
---|
[ac109439] | 171 | <screen><userinput><command>install -o mysql -d /var/run/mysql &&
|
---|
| 172 | mysqld_safe --user=mysql 2>&1 >/dev/null &</command></userinput></screen>
|
---|
[08254fc] | 173 |
|
---|
[4b93ac2] | 174 | <para>A default installation does not setup a password for the administrator,
|
---|
| 175 | so use the following command to set one. Replace
|
---|
| 176 | <replaceable>[new-password]</replaceable> with your own.</para>
|
---|
[08254fc] | 177 |
|
---|
| 178 | <screen><userinput><command>mysqladmin -u root password <replaceable>[new-password]</replaceable></command></userinput></screen>
|
---|
| 179 |
|
---|
| 180 | <para>Configuration of the server is now finished. Shut the server down
|
---|
| 181 | using the following command:</para>
|
---|
| 182 |
|
---|
| 183 | <screen><userinput><command>mysqladmin -p shutdown</command></userinput></screen>
|
---|
| 184 |
|
---|
| 185 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename>
|
---|
[4b93ac2] | 186 | init script included in the <xref linkend="intro-important-bootscripts"/>
|
---|
| 187 | package.</para>
|
---|
| 188 |
|
---|
[08254fc] | 189 | <screen><userinput><command>make install-mysql</command></userinput></screen>
|
---|
| 190 |
|
---|
| 191 | </sect3>
|
---|
| 192 |
|
---|
| 193 | </sect2>
|
---|
| 194 |
|
---|
| 195 | <sect2>
|
---|
| 196 | <title>Contents</title>
|
---|
| 197 |
|
---|
[54b4a3e] | 198 | <para>The <application>My<acronym>SQL</acronym></application> package contains
|
---|
[867e611] | 199 | <command>client_test</command>,
|
---|
[54b4a3e] | 200 | <command>comp_err</command>, <command>
|
---|
[08254fc] | 201 | isamchk</command>, <command>
|
---|
| 202 | isamlog</command>, <command>
|
---|
[4b93ac2] | 203 | make_win_binary_distribution</command>, <command>
|
---|
[08254fc] | 204 | make_win_src_distribution</command>, <command>
|
---|
| 205 | msql2mysql</command>, <command>
|
---|
| 206 | my_print_defaults</command>, <command>
|
---|
[4b93ac2] | 207 | myisam_ftdump</command>, <command>
|
---|
[08254fc] | 208 | myisamchk</command>, <command>
|
---|
| 209 | myisamlog</command>, <command>
|
---|
| 210 | myisampack</command>, <command>
|
---|
| 211 | mysql</command>, <command>
|
---|
| 212 | mysql_config</command>, <command>
|
---|
| 213 | mysql_convert_table_format</command>, <command>
|
---|
[867e611] | 214 | mysql_create_system_tables</command>, <command>
|
---|
[08254fc] | 215 | mysql_explain_log</command>, <command>
|
---|
| 216 | mysql_find_rows</command>, <command>
|
---|
| 217 | mysql_fix_extensions</command>, <command>
|
---|
| 218 | mysql_fix_privilege_tables</command>, <command>
|
---|
| 219 | mysql_install_db</command>, <command>
|
---|
| 220 | mysql_secure_installation</command>, <command>
|
---|
| 221 | mysql_setpermission</command>, <command>
|
---|
| 222 | mysql_tableinfo</command>, <command>
|
---|
[867e611] | 223 | mysql_tzinfo_to_sql</command>, <command>
|
---|
[08254fc] | 224 | mysql_waitpid</command>, <command>
|
---|
| 225 | mysql_zap</command>, <command>
|
---|
| 226 | mysqlacess</command>,<command>
|
---|
| 227 | mysqladmin</command>, <command>
|
---|
| 228 | mysqlbinlog</command>, <command>
|
---|
| 229 | mysqlbug</command>, <command>
|
---|
| 230 | mysqlcheck</command>, <command>
|
---|
| 231 | mysqld</command>, <command>
|
---|
| 232 | mysqld_multi</command>, <command>
|
---|
| 233 | mysqld_safe</command>, <command>
|
---|
| 234 | mysqldump</command>, <command>
|
---|
| 235 | mysqldumpslow</command>, <command>
|
---|
| 236 | mysqlhotcopy</command>, <command>
|
---|
| 237 | mysqlimport</command>, <command>
|
---|
| 238 | mysqlmanager</command>, <command>
|
---|
| 239 | mysqlmanager-pwgen</command>, <command>
|
---|
| 240 | mysqlmanagerc</command>, <command>
|
---|
| 241 | mysqlshow</command>, <command>
|
---|
| 242 | mysqltest</command>, <command>
|
---|
| 243 | pack_isam</command>, <command>
|
---|
| 244 | perror</command>, <command>
|
---|
| 245 | replace</command>, <command>
|
---|
| 246 | resolve_stack_dump</command>, <command>
|
---|
| 247 | resolveip</command>, <filename class="libraryfile">
|
---|
| 248 | libdbug</filename>, <filename class="libraryfile">
|
---|
| 249 | libheap</filename>, <filename class="libraryfile">
|
---|
| 250 | libmerge</filename>, <filename class="libraryfile">
|
---|
| 251 | libmyisam</filename>, <filename class="libraryfile">
|
---|
| 252 | libmyisammrg</filename>, <filename class="libraryfile">
|
---|
| 253 | libmysqlclient</filename>, <filename class="libraryfile">
|
---|
[4b93ac2] | 254 | libmysqlclient_r</filename>, <filename class="libraryfile">
|
---|
[08254fc] | 255 | libmystrings</filename>, <filename class="libraryfile">
|
---|
| 256 | libmysys</filename>, <filename class="libraryfile">
|
---|
| 257 | libnisam</filename> and <filename class="libraryfile">
|
---|
| 258 | libvio</filename>.</para>
|
---|
| 259 |
|
---|
| 260 | </sect2>
|
---|
| 261 |
|
---|
| 262 | <sect2><title>Description</title>
|
---|
| 263 |
|
---|
[4b93ac2] | 264 | <para>A package listing would be several pages long. Consult the
|
---|
| 265 | <application>My<acronym>SQL</acronym></application> documentation for full
|
---|
| 266 | details instead.</para>
|
---|
[08254fc] | 267 |
|
---|
[4b93ac2] | 268 | <para>Certain <application>My<acronym>SQL</acronym></application> support
|
---|
| 269 | programs may require the <application>Perl</application> DBI modules to be
|
---|
| 270 | installed to function properly.</para>
|
---|
[08254fc] | 271 |
|
---|
| 272 | </sect2>
|
---|
[f45b1953] | 273 |
|
---|
| 274 | </sect1>
|
---|