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

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 # to the database without requiring a passwort input
rootpassword="$(cat "$__object/parameter/password")" rootpassword="$(cat "$__object/parameter/password")"
# set root password # set root password
mysqladmin -u root password $rootpassword 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 # remove anonymous users
mysql -u root -p <<-EOF mysql -u root -p <<-EOF
DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.user WHERE User='';