summaryrefslogtreecommitdiff
path: root/files/scripts/Debian/setmysqlpass.sh
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2015-01-24 18:05:08 +0100
committermh <mh@immerda.ch>2015-01-24 18:05:08 +0100
commite1649647f326abeb256a73e4cb1060840f846f24 (patch)
tree28ce305f242f98022d5c87280979230129854eec /files/scripts/Debian/setmysqlpass.sh
parentfd71b9473fcb4c4e9f839bd9e579e899d424b71f (diff)
fix issues for EL7 + simplify account security
* EL7 uses mariadb & systemd -> adjust setpasswd script to that * move the security ensurance to the setpassword script, as it's easier to ensure that there
Diffstat (limited to 'files/scripts/Debian/setmysqlpass.sh')
-rw-r--r--files/scripts/Debian/setmysqlpass.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/files/scripts/Debian/setmysqlpass.sh b/files/scripts/Debian/setmysqlpass.sh
index ec2c971..3a3e336 100644
--- a/files/scripts/Debian/setmysqlpass.sh
+++ b/files/scripts/Debian/setmysqlpass.sh
@@ -12,6 +12,7 @@ rootpw=$(grep password /root/.my.cnf | sed -e 's/^[^=]*= *\(.*\) */\1/')
sleep 5
mysql -u root mysql <<EOF
UPDATE mysql.user SET Password=PASSWORD('$rootpw') WHERE User='root' AND Host='localhost';
+DELETE FROM mysql.user WHERE (User='root' AND Host!='localhost') OR USER='';
FLUSH PRIVILEGES;
EOF
killall mysqld