fixed the generating of .my.cnf

This commit is contained in:
Benedikt Koeppel 2012-02-18 21:50:26 +01:00
parent dc5fb8b769
commit 3ceb643487
1 changed files with 6 additions and 1 deletions

View File

@ -19,13 +19,18 @@
#
#
# store the root password in /root/.my.cnf so that processes can connect
# to the database without requiring a passwort input
rootpassword="$(cat "$__object/parameter/password")"
# set root password
mysqladmin -u root password $rootpassword
# store the root password in /root/.my.cnf so that processes can connect
cat <<-EOF > /root/.my.cnf
[client]
password=$rootpassword
EOF
# remove anonymous users
mysql -u root -p <<-EOF
DELETE FROM mysql.user WHERE User='';