diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-01-19 14:30:43 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-01-19 14:30:43 -0200 |
commit | 5431b7ee731a59b0fe4a6b5df6645135b82e539c (patch) | |
tree | 5514c54400f1f0f23395d09155d83485184c67e1 | |
parent | b70a99a624f177c2ce0aa28dd826ff4c3e1816d0 (diff) | |
download | puppet-mysql-5431b7ee731a59b0fe4a6b5df6645135b82e539c.tar.gz puppet-mysql-5431b7ee731a59b0fe4a6b5df6645135b82e539c.tar.bz2 |
Cleanup
-rw-r--r-- | templates/setmysqlpass.sh.erb | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/templates/setmysqlpass.sh.erb b/templates/setmysqlpass.sh.erb index 902336a..9cb3d39 100644 --- a/templates/setmysqlpass.sh.erb +++ b/templates/setmysqlpass.sh.erb @@ -1,36 +1,12 @@ #!/bin/bash # -# Set MySQL password. +# Change MySQL root password. # # Config -SERVICE="/etc/init.d/mysql" PASSWORD="<%= mysql_rootpw %>" -DATADIR="/var/lib/mysql/data" -LOGBIN="/var/lib/mysql/mysql-bin" -USER="mysql" -GROUP="mysql" DEFAULTS="/etc/mysql/debian.cnf" -# Stop service -#$SERVICE stop - -# Start without grant tables -# This seems unsafe as opens a race condition. -#/usr/libexec/mysqld --skip-grant-tables --user=root --datadir=$DATADIR log-bin=$LOGBIN & - -# Wait -#sleep 5 - -# Change root password +# Run echo "USE mysql; UPDATE user SET Password=PASSWORD('$PASSWORD') WHERE User='root' AND Host='localhost';" | \ /usr/bin/mysql --defaults-file=$DEFAULTS - -# Kill the daemon -#killall mysqld - -# Chown to be on the safe side -#chown $USER.$GROUP $LOGBIN* - -# Start service -#$SERVICE start |