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