source: content/databases/mysql/mysql-config.xml@ a338b48

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since a338b48 was 7d036ae7, checked in by Jesse Tie-Ten-Quee <highos@…>, 22 years ago

Upgraded mysql to 3.23.52. Some description fixes and changing the mysql db
location to better reflect the FHS.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@157 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 3.3 KB
Line 
1<sect2>
2<title>Configuring mysql</title>
3
4<sect3>
5<title>Config files</title>
6
7<para><userinput>/etc/my.cnf, ~/.my.cnf</userinput></para>
8
9</sect3>
10
11<sect3>
12<title>Configuration Information</title>
13
14<para>There are several default configurations file available in
15/usr/share/mysql which you can use.</para>
16
17<screen><userinput>cp /usr/share/mysql/my-medium.cnf /etc/my.cnf</userinput></screen>
18
19<para>We can now install a database and change the ownership to the
20unpriviledged user and group.</para>
21
22<screen><userinput>mysql_install_db
23chown -R mysql:mysql /var/lib/mysql</userinput></screen>
24
25<para>Further configuration requires that the mysql server be running:</para>
26
27<screen><userinput>safe_mysqld 2&gt;&amp;1 &gt;/dev/null &amp;</userinput></screen>
28
29<para>A default installation, does not setup a password for the administrator.
30So here we will login and set one. We strongly suggest changing
31'new-password' to your own.</para>
32
33<screen><userinput>mysql -uroot mysql</userinput>
34Welcome to the MySQL monitor. Commands end with ; or \g.
35Your MySQL connection id is 2 to server version: 3.23.51-log
36
37Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
38
39mysql&gt; <userinput>UPDATE user SET password=password('new-password') WHERE user='root';</userinput>
40Query OK, 2 rows affected (0.00 sec)
41Rows matched: 2 Changed: 2 Warnings: 0
42
43mysql&gt; <userinput>FLUSH PRIVILEGES;</userinput>
44Query OK, 0 rows affected (0.00 sec)
45
46mysql&gt; <userinput>EXIT;</userinput>
47bye
48</screen>
49
50<para>Now that we are done with the configuration of the server, we can
51shut it down.</para>
52
53<screen><userinput>kill `pidof -x safe_mysqld mysqld`</userinput></screen>
54
55
56<sect4>
57<title>mysql init.d script</title>
58
59<para>To automate the running of mysql, use the following command to create
60the init.d script:</para>
61
62<screen><userinput>cat &gt; /etc/rc.d/init.d/mysql &lt;&lt; "EOF"</userinput>
63#!/bin/bash
64# Begin $rc_base/init.d/
65
66# Based on sysklogd script from LFS-3.1 and earlier.
67# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
68
69source /etc/sysconfig/rc
70source $rc_functions
71
72case "$1" in
73 start)
74 echo "Starting MySQL daemon..."
75 /usr/bin/safe_mysqld 2&gt;&amp;1 &gt;/dev/null &amp;
76 evaluate_retval
77 ;;
78
79 stop)
80 echo "Stopping MySQL daemon..."
81 killproc mysqld
82 ;;
83
84 restart)
85 $0 stop
86 sleep 1
87 $0 start
88 ;;
89
90 status)
91 statusproc /usr/sbin/mysqld
92 ;;
93
94 *)
95 echo "Usage: $0 {start|stop|restart|status}"
96 exit 1
97 ;;
98esac
99
100# End $rc_base/init.d/
101<userinput>EOF
102chmod 755 /etc/rc.d/init.d/mysql</userinput></screen>
103
104<para>Create the symbolic links to this file in the relevant rc.d directory
105with the following commands:</para>
106
107<screen><userinput>cd /etc/rc.d/init.d &amp;&amp;
108ln -sf ../init.d/mysql ../rc0.d/K26mysql &amp;&amp;
109ln -sf ../init.d/mysql ../rc1.d/K26mysql &amp;&amp;
110ln -sf ../init.d/mysql ../rc2.d/K26mysql &amp;&amp;
111ln -sf ../init.d/mysql ../rc3.d/S34mysql &amp;&amp;
112ln -sf ../init.d/mysql ../rc4.d/S34mysql &amp;&amp;
113ln -sf ../init.d/mysql ../rc5.d/S34mysql &amp;&amp;
114ln -sf ../init.d/mysql ../rc6.d/K26mysql</userinput></screen>
115
116</sect4>
117
118</sect3>
119
120</sect2>
121
Note: See TracBrowser for help on using the repository browser.