[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 |
|
---|
| 7 | <!ENTITY mysql-download-http "http://mysql.he.net/Downloads/MySQL-4.0/mysql-&mysql-version;.tar.gz">
|
---|
| 8 | <!ENTITY mysql-download-ftp "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-4.0/mysql-&mysql-version;.tar.gz">
|
---|
[fd015ac] | 9 | <!ENTITY mysql-md5 "0a3dae16519afa5e59d8b9e252181243">
|
---|
[54b4a3e] | 10 | <!ENTITY mysql-size "14.1 MB">
|
---|
| 11 | <!ENTITY mysql-buildsize "117 MB">
|
---|
| 12 | <!ENTITY mysql-time "2.83 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'>
|
---|
| 34 | <listitem><para>Download (HTTP): <ulink url="&mysql-download-http;"/></para></listitem>
|
---|
| 35 | <listitem><para>Download (FTP): <ulink url="&mysql-download-ftp;"/></para></listitem>
|
---|
[fd015ac] | 36 | <listitem><para>MD5 Sum: &mysql-md5;</para></listitem>
|
---|
[08254fc] | 37 | <listitem><para>Download size: &mysql-size;</para></listitem>
|
---|
[54b4a3e] | 38 | <listitem><para>Estimated disk space required: &mysql-buildsize;</para></listitem>
|
---|
[08254fc] | 39 | <listitem><para>Estimated build time: &mysql-time;</para></listitem></itemizedlist>
|
---|
| 40 | </sect3>
|
---|
| 41 |
|
---|
[4b93ac2] | 42 | <sect3><title><application>My<acronym>SQL</acronym></application> dependencies
|
---|
| 43 | </title>
|
---|
[08254fc] | 44 | <sect4><title>Optional</title>
|
---|
[5c89a13] | 45 | <para><xref linkend="openssl"/>, <xref linkend="tcpwrappers"/>,
|
---|
| 46 | <xref linkend="which"/> and <xref linkend="ORBit"/>
|
---|
[08254fc] | 47 | </para></sect4>
|
---|
| 48 | </sect3>
|
---|
| 49 |
|
---|
| 50 | </sect2>
|
---|
| 51 |
|
---|
| 52 | <sect2>
|
---|
[4b93ac2] | 53 | <title>Installation of <application>My<acronym>SQL</acronym></application>
|
---|
| 54 | </title>
|
---|
[08254fc] | 55 |
|
---|
| 56 | <para>For security reasons, running the server as an unprivileged user
|
---|
| 57 | and group is strongly encouraged:</para>
|
---|
| 58 |
|
---|
| 59 | <screen><userinput><command>groupadd mysql &&
|
---|
| 60 | useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql</command></userinput></screen>
|
---|
| 61 |
|
---|
[4b93ac2] | 62 | <para>Build and install <application>My<acronym>SQL</acronym></application> by
|
---|
| 63 | running the following commands:</para>
|
---|
[08254fc] | 64 |
|
---|
[c2c2d76] | 65 | <screen><userinput><command>CPPFLAGS="-D_GNU_SOURCE" ./configure --prefix=/usr --sysconfdir=/etc \
|
---|
[4b93ac2] | 66 | --libexecdir=/usr/sbin --localstatedir=/srv/mysql \
|
---|
| 67 | --enable-thread-safe-client --enable-assembler \
|
---|
| 68 | --without-readline --without-debug \
|
---|
[c2c2d76] | 69 | --enable-local-infile --without-bench \
|
---|
| 70 | --with-named-thread-libs=-lpthread &&
|
---|
[08254fc] | 71 | make testdir=/usr/lib/mysql/mysql-test &&
|
---|
[4b93ac2] | 72 | make testdir=/usr/lib/mysql/mysql-test install &&
|
---|
| 73 | cd /usr/lib &&
|
---|
| 74 | ln -sf mysql/libmysqlclient{,_r}.so* .</command></userinput></screen>
|
---|
| 75 |
|
---|
| 76 | </sect2>
|
---|
| 77 |
|
---|
| 78 | <sect2>
|
---|
| 79 | <title>Command explanations</title>
|
---|
[08254fc] | 80 |
|
---|
[4b93ac2] | 81 | <para><parameter>--libexecdir=/usr/sbin</parameter>: This switch installs the
|
---|
| 82 | <command>mysqld</command> daemon in an appropriate location.</para>
|
---|
[08254fc] | 83 |
|
---|
[4b93ac2] | 84 | <para><parameter>--localstatedir=/srv/mysql</parameter>: This switch forces
|
---|
| 85 | <application>My<acronym>SQL</acronym></application> to use
|
---|
| 86 | <filename class='directory'>/srv/mysql</filename> for database files and other
|
---|
| 87 | variable data.</para>
|
---|
| 88 |
|
---|
| 89 | <para><parameter>--enable-thread-safe-client</parameter>: This switch compiles a
|
---|
| 90 | thread-safe <application>My<acronym>SQL</acronym></application> client library.
|
---|
| 91 | </para>
|
---|
| 92 |
|
---|
| 93 | <para><parameter>--enable-assembler</parameter>: This switch allows using
|
---|
| 94 | assembler versions of some string functions.</para>
|
---|
| 95 |
|
---|
| 96 | <para><parameter>--without-readline</parameter>: This switch forces the build
|
---|
| 97 | to use the system copy of <application>readline</application> instead of the
|
---|
| 98 | bundled copy.</para>
|
---|
| 99 |
|
---|
| 100 | <para><option>--enable-local-infile</option>: This switch enables the
|
---|
| 101 | LOAD DATA INFILE <acronym>SQL</acronym> statement.</para>
|
---|
| 102 |
|
---|
| 103 | <para><option>--without-bench</option>: This switch skips building the
|
---|
| 104 | benchmark suite.</para>
|
---|
| 105 |
|
---|
[c2c2d76] | 106 | <para><parameter>CPPFLAGS="-D_GNU_SOURCE" --with-named-thread-libs=-lpthread</parameter>:
|
---|
| 107 | This environment variable and configure switch enable building on
|
---|
| 108 | <acronym>NPTL</acronym> systems.</para>
|
---|
| 109 |
|
---|
[4b93ac2] | 110 | <para><command>make testdir=...</command>: This installs the test suite in
|
---|
| 111 | <filename class='directory'>/usr/lib/mysql/mysql-test</filename>.
|
---|
| 112 | <acronym>BLFS</acronym> is currently seeking a method to omit the installation
|
---|
| 113 | of the test suite altogether.</para>
|
---|
| 114 |
|
---|
[2fa0880] | 115 | <para><command>ln -sf mysql/libmysqlclient{,_r}.so* .</command>: This command
|
---|
[4b93ac2] | 116 | makes the <application>My<acronym>SQL</acronym></application> shared libraries
|
---|
| 117 | available to other packages at run-time.</para>
|
---|
[08254fc] | 118 |
|
---|
| 119 | </sect2>
|
---|
| 120 |
|
---|
| 121 | <sect2>
|
---|
| 122 | <title>Configuring <application>My<acronym>SQL</acronym></application></title>
|
---|
| 123 |
|
---|
| 124 | <sect3>
|
---|
| 125 | <title>Config files</title>
|
---|
| 126 |
|
---|
| 127 | <para><filename>/etc/my.cnf</filename>, <filename>~/.my.cnf</filename></para>
|
---|
| 128 |
|
---|
| 129 | </sect3>
|
---|
| 130 |
|
---|
| 131 | <sect3>
|
---|
| 132 | <title>Configuration Information</title>
|
---|
| 133 |
|
---|
| 134 | <para>There are several default configuration files available in
|
---|
| 135 | <filename class="directory">/usr/share/mysql</filename> which you can
|
---|
| 136 | use. Create <filename>/etc/my.cnf</filename> using the following
|
---|
| 137 | command:</para>
|
---|
| 138 |
|
---|
| 139 | <screen><userinput><command>cp /usr/share/mysql/my-medium.cnf /etc/my.cnf</command></userinput></screen>
|
---|
| 140 |
|
---|
| 141 | <para>You can now install a database and change the ownership to the
|
---|
| 142 | unprivileged user and group.</para>
|
---|
| 143 |
|
---|
| 144 | <screen><userinput><command>mysql_install_db &&
|
---|
[4b93ac2] | 145 | chown -R mysql:mysql /srv/mysql</command></userinput></screen>
|
---|
[08254fc] | 146 |
|
---|
[4b93ac2] | 147 | <para>Further configuration requires that the
|
---|
| 148 | <application>My<acronym>SQL</acronym></application> server be running:</para>
|
---|
[08254fc] | 149 |
|
---|
| 150 | <screen><userinput><command>mysqld_safe --user=mysql 2>&1 >/dev/null &</command></userinput></screen>
|
---|
| 151 |
|
---|
[4b93ac2] | 152 | <para>A default installation does not setup a password for the administrator,
|
---|
| 153 | so use the following command to set one. Replace
|
---|
| 154 | <replaceable>[new-password]</replaceable> with your own.</para>
|
---|
[08254fc] | 155 |
|
---|
[15f5d9f] | 156 | <!--
|
---|
[08254fc] | 157 | <screen><userinput><command>mysql -uroot mysql</command></userinput>
|
---|
| 158 | Welcome to the MySQL monitor. Commands end with ; or \g.
|
---|
| 159 | Your MySQL connection id is 2 to server version: 3.23.51-log
|
---|
| 160 |
|
---|
| 161 | Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
|
---|
| 162 |
|
---|
| 163 | <prompt>mysql></prompt> <userinput><command>UPDATE user SET password=password('<replaceable>new-password</replaceable>') WHERE user='root';</command></userinput>
|
---|
| 164 | Query OK, 2 rows affected (0.00 sec)
|
---|
| 165 | Rows matched: 2 Changed: 2 Warnings: 0
|
---|
| 166 |
|
---|
| 167 | <prompt>mysql></prompt> <userinput><command>FLUSH PRIVILEGES;</command></userinput>
|
---|
| 168 | Query OK, 0 rows affected (0.00 sec)
|
---|
| 169 |
|
---|
| 170 | <prompt>mysql></prompt> <userinput><command>EXIT;</command></userinput>
|
---|
| 171 | bye
|
---|
| 172 | </screen>
|
---|
[15f5d9f] | 173 | -->
|
---|
[08254fc] | 174 |
|
---|
| 175 | <screen><userinput><command>mysqladmin -u root password <replaceable>[new-password]</replaceable></command></userinput></screen>
|
---|
| 176 |
|
---|
| 177 | <para>Configuration of the server is now finished. Shut the server down
|
---|
| 178 | using the following command:</para>
|
---|
| 179 |
|
---|
| 180 | <screen><userinput><command>mysqladmin -p shutdown</command></userinput></screen>
|
---|
| 181 |
|
---|
| 182 | <para>Install the <filename>/etc/rc.d/init.d/mysql</filename>
|
---|
[4b93ac2] | 183 | init script included in the <xref linkend="intro-important-bootscripts"/>
|
---|
| 184 | package.</para>
|
---|
| 185 |
|
---|
[08254fc] | 186 | <screen><userinput><command>make install-mysql</command></userinput></screen>
|
---|
| 187 |
|
---|
| 188 | </sect3>
|
---|
| 189 |
|
---|
| 190 | </sect2>
|
---|
| 191 |
|
---|
| 192 | <sect2>
|
---|
| 193 | <title>Contents</title>
|
---|
| 194 |
|
---|
[54b4a3e] | 195 | <para>The <application>My<acronym>SQL</acronym></application> package contains
|
---|
| 196 | <command>comp_err</command>, <command>
|
---|
[08254fc] | 197 | isamchk</command>, <command>
|
---|
| 198 | isamlog</command>, <command>
|
---|
[4b93ac2] | 199 | make_win_binary_distribution</command>, <command>
|
---|
[08254fc] | 200 | make_win_src_distribution</command>, <command>
|
---|
| 201 | msql2mysql</command>, <command>
|
---|
| 202 | my_print_defaults</command>, <command>
|
---|
[4b93ac2] | 203 | myisam_ftdump</command>, <command>
|
---|
[08254fc] | 204 | myisamchk</command>, <command>
|
---|
| 205 | myisamlog</command>, <command>
|
---|
| 206 | myisampack</command>, <command>
|
---|
| 207 | mysql</command>, <command>
|
---|
| 208 | mysql_config</command>, <command>
|
---|
| 209 | mysql_convert_table_format</command>, <command>
|
---|
| 210 | mysql_explain_log</command>, <command>
|
---|
| 211 | mysql_find_rows</command>, <command>
|
---|
| 212 | mysql_fix_extensions</command>, <command>
|
---|
| 213 | mysql_fix_privilege_tables</command>, <command>
|
---|
| 214 | mysql_install</command>, <command>
|
---|
| 215 | mysql_install_db</command>, <command>
|
---|
| 216 | mysql_secure_installation</command>, <command>
|
---|
| 217 | mysql_setpermission</command>, <command>
|
---|
| 218 | mysql_tableinfo</command>, <command>
|
---|
| 219 | mysql_waitpid</command>, <command>
|
---|
| 220 | mysql_zap</command>, <command>
|
---|
| 221 | mysqlacess</command>,<command>
|
---|
| 222 | mysqladmin</command>, <command>
|
---|
| 223 | mysqlbinlog</command>, <command>
|
---|
| 224 | mysqlbug</command>, <command>
|
---|
| 225 | mysqlcheck</command>, <command>
|
---|
| 226 | mysqld</command>, <command>
|
---|
| 227 | mysqld_multi</command>, <command>
|
---|
| 228 | mysqld_safe</command>, <command>
|
---|
| 229 | mysqldump</command>, <command>
|
---|
| 230 | mysqldumpslow</command>, <command>
|
---|
| 231 | mysqlhotcopy</command>, <command>
|
---|
| 232 | mysqlimport</command>, <command>
|
---|
| 233 | mysqlmanager</command>, <command>
|
---|
| 234 | mysqlmanager-pwgen</command>, <command>
|
---|
| 235 | mysqlmanagerc</command>, <command>
|
---|
| 236 | mysqlshow</command>, <command>
|
---|
| 237 | mysqltest</command>, <command>
|
---|
| 238 | pack_isam</command>, <command>
|
---|
| 239 | perror</command>, <command>
|
---|
| 240 | replace</command>, <command>
|
---|
| 241 | resolve_stack_dump</command>, <command>
|
---|
| 242 | resolveip</command>, <filename class="libraryfile">
|
---|
| 243 | libdbug</filename>, <filename class="libraryfile">
|
---|
| 244 | libheap</filename>, <filename class="libraryfile">
|
---|
| 245 | libmerge</filename>, <filename class="libraryfile">
|
---|
| 246 | libmyisam</filename>, <filename class="libraryfile">
|
---|
| 247 | libmyisammrg</filename>, <filename class="libraryfile">
|
---|
| 248 | libmysqlclient</filename>, <filename class="libraryfile">
|
---|
[4b93ac2] | 249 | libmysqlclient_r</filename>, <filename class="libraryfile">
|
---|
[08254fc] | 250 | libmystrings</filename>, <filename class="libraryfile">
|
---|
| 251 | libmysys</filename>, <filename class="libraryfile">
|
---|
| 252 | libnisam</filename> and <filename class="libraryfile">
|
---|
| 253 | libvio</filename>.</para>
|
---|
| 254 |
|
---|
| 255 | </sect2>
|
---|
| 256 |
|
---|
| 257 | <sect2><title>Description</title>
|
---|
| 258 |
|
---|
[4b93ac2] | 259 | <para>A package listing would be several pages long. Consult the
|
---|
| 260 | <application>My<acronym>SQL</acronym></application> documentation for full
|
---|
| 261 | details instead.</para>
|
---|
[08254fc] | 262 |
|
---|
[4b93ac2] | 263 | <para>Certain <application>My<acronym>SQL</acronym></application> support
|
---|
| 264 | programs may require the <application>Perl</application> DBI modules to be
|
---|
| 265 | installed to function properly.</para>
|
---|
[08254fc] | 266 |
|
---|
| 267 | </sect2>
|
---|
[f45b1953] | 268 |
|
---|
| 269 | </sect1>
|
---|