changeset 405:ab9311e91aca

Make sure main DB admin gets GRANT OPTION!
author IBBoard <dev@ibboard.co.uk>
date Wed, 20 Apr 2022 19:43:49 +0100
parents 4e9959052fb6
children b59e6ce49e24
files modules/website/manifests/mysql.pp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/website/manifests/mysql.pp	Wed Apr 20 19:43:19 2022 +0100
+++ b/modules/website/manifests/mysql.pp	Wed Apr 20 19:43:49 2022 +0100
@@ -56,7 +56,7 @@
   $password = strip($mysqlpassword)
   $configured_marker = "/etc/.${mysqlprefix}.is-configured"
   exec { 'Rename root MySQL user for security':
-    command  => "mysql -uroot -e 'GRANT ALL ON *.* TO \"$username\"@\"localhost\" IDENTIFIED BY \"$password\"; DELETE FROM mysql.user WHERE User = \"root\" AND plugin != \"unix_socket\"; DELETE FROM mysql.user WHERE User = \"\"; FLUSH PRIVILEGES;' && touch $configured_marker",
+    command  => "mysql -uroot -e 'GRANT ALL ON *.* TO \"$username\"@\"localhost\" IDENTIFIED BY \"$password\" WITH GRANT OPTION; DELETE FROM mysql.user WHERE User = \"root\" AND plugin != \"unix_socket\"; DELETE FROM mysql.user WHERE User = \"\"; FLUSH PRIVILEGES;' && touch $configured_marker",
     provider => shell,
     creates  => $configured_marker,
     require  => Class['mysql::server'],