diff options
author | Fabian Affolter <fabian@bernewireless.net> | 2010-11-09 00:15:43 +0100 |
---|---|---|
committer | Fabian Affolter <fabian@bernewireless.net> | 2010-11-09 00:15:43 +0100 |
commit | 391406c85d86dc931f3fdb2483a14d0f1e7e6355 (patch) | |
tree | 97fe00f6a9dcf5d821139766b213418d57b5d31b /doc/appendix/files/mysql.txt | |
parent | 553c693618321fad2a88030b16d42d3253befaec (diff) | |
download | bcfg2-391406c85d86dc931f3fdb2483a14d0f1e7e6355.tar.gz bcfg2-391406c85d86dc931f3fdb2483a14d0f1e7e6355.tar.bz2 bcfg2-391406c85d86dc931f3fdb2483a14d0f1e7e6355.zip |
doc: Massive update
Diffstat (limited to 'doc/appendix/files/mysql.txt')
-rw-r--r-- | doc/appendix/files/mysql.txt | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/appendix/files/mysql.txt b/doc/appendix/files/mysql.txt new file mode 100644 index 000000000..ae4a1450b --- /dev/null +++ b/doc/appendix/files/mysql.txt @@ -0,0 +1,63 @@ +.. -*- mode: rst -*- + +.. _getting_started-mysql: + +.. Author: Patrick Ruckstuhl + +Mysql example +============= + +I had some time ago to continue with putting my configuration into +Bcfg2 and maybe this helps someone else. + +I added a new bundle: + +.. code-block:: xml + + <Bundle name="mysql-server" version="3.0"> + <ConfigFile name="/root/bcfg2-install/mysql/users.sh"/> + <ConfigFile name="/root/bcfg2-install/mysql/users.sql"/> + <PostInstall name="/root/bcfg2-install/mysql/users.sh"/> + <Package name="mysql-server-4.1"/> + <Service name="mysql"/> + </Bundle> + +The ``users.sh`` script looks like this: + +.. code-block:: sh + + #!/bin/sh + + mysql --defaults-extra-file=/etc/mysql/debian.cnf mysql \ + < /root/bcfg2-install/mysql/users.sql + +On debian there is a user account in ``/etc/mysql/debian.cnf`` +automatically created, but you could also (manually) create a +user in the database that has enough permissions and add the +login information in a file yourself. This file looks like this: + +.. code-block:: sh + + [client] + host = localhost + user = debian-sys-maint + password = XXXXXXXXXX + +The ``users.sql`` looks like this: + +.. code-block:: sh + + DELETE FROM db; + INSERT INTO db VALUES ('localhost', 'phpmyadmin', 'pma', 'Y', 'Y', + 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'); + + DELETE FROM user WHERE User <> 'debian-sys-maint'; + INSERT INTO user VALUES ('localhost', 'root', 'XXXXXXXXXXX', 'Y', 'Y', + 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', + 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0); + INSERT INTO user VALUES ('localhost', 'pma', '', 'N', 'N', 'N', 'N', + 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', + 'N', 'N', 'N', '', '', '', '', 0, 0, 0); + + FLUSH PRIVILEGES; + |