diff options
-rw-r--r-- | templates/setmysqlpass.sh.erb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/setmysqlpass.sh.erb b/templates/setmysqlpass.sh.erb index fbca07e..1cc34db 100644 --- a/templates/setmysqlpass.sh.erb +++ b/templates/setmysqlpass.sh.erb @@ -8,5 +8,7 @@ PASSWORD="<%= mysql_rootpw %>" DEFAULTS="/etc/mysql/debian.cnf" # Run -echo "USE mysql; UPDATE user SET Password=PASSWORD('$PASSWORD') WHERE User='root' AND Host='localhost'; flush privileges;" | \ - /usr/bin/mysql --defaults-file=$DEFAULTS +/usr/bin/mysql --defaults-file=$DEFAULTS <<EOF +UPDATE mysql.user SET Password=PASSWORD('$PASSWORD') WHERE User='root' AND Host='localhost'; +FLUSH PRIVILEGES; +EOF |