diff --git a/recipes/newrelic/infrastructure/ohi/mysql/debian.yml b/recipes/newrelic/infrastructure/ohi/mysql/debian.yml index 238bf61fb..b3b45b306 100644 --- a/recipes/newrelic/infrastructure/ohi/mysql/debian.yml +++ b/recipes/newrelic/infrastructure/ohi/mysql/debian.yml @@ -183,10 +183,9 @@ install: sudo rm -f /tmp/sql-create-user.sql fi sudo tee -a /tmp/sql-create-user.sql > /dev/null <<"EOT" - DROP USER IF EXISTS 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; - CREATE USER 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; - GRANT REPLICATION CLIENT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; - GRANT SELECT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; + GRANT USAGE ON *.* to 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; + DROP USER 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; + GRANT REPLICATION CLIENT, SELECT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; EOT sudo sed -i 's/NEW_RELIC_MYSQL_USERNAME/'$NEW_RELIC_MYSQL_USERNAME'/g' /tmp/sql-create-user.sql sudo sed -i 's/NEW_RELIC_MYSQL_PASSWORD/'$NEW_RELIC_MYSQL_PASSWORD'/g' /tmp/sql-create-user.sql diff --git a/recipes/newrelic/infrastructure/ohi/mysql/rhel.yml b/recipes/newrelic/infrastructure/ohi/mysql/rhel.yml index 2c9d34d1f..41d22f9ad 100644 --- a/recipes/newrelic/infrastructure/ohi/mysql/rhel.yml +++ b/recipes/newrelic/infrastructure/ohi/mysql/rhel.yml @@ -172,10 +172,9 @@ install: sudo rm -f /tmp/sql-create-user.sql fi sudo tee -a /tmp/sql-create-user.sql > /dev/null <<"EOT" - DROP USER IF EXISTS 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; - CREATE USER 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; - GRANT REPLICATION CLIENT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; - GRANT SELECT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; + GRANT USAGE ON *.* to 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; + DROP USER 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; + GRANT REPLICATION CLIENT, SELECT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; EOT sudo sed -i 's/NEW_RELIC_MYSQL_USERNAME/'$NEW_RELIC_MYSQL_USERNAME'/g' /tmp/sql-create-user.sql sudo sed -i 's/NEW_RELIC_MYSQL_PASSWORD/'$NEW_RELIC_MYSQL_PASSWORD'/g' /tmp/sql-create-user.sql diff --git a/recipes/newrelic/infrastructure/ohi/mysql/suse.yml b/recipes/newrelic/infrastructure/ohi/mysql/suse.yml index 816578fb8..49c736dc8 100644 --- a/recipes/newrelic/infrastructure/ohi/mysql/suse.yml +++ b/recipes/newrelic/infrastructure/ohi/mysql/suse.yml @@ -169,10 +169,9 @@ install: fi sudo tee -a /tmp/sql-create-user.sql > /dev/null <<"EOT" - DROP USER IF EXISTS 'NR_CLI_DB_USERNAME'@'localhost'; - CREATE USER 'NR_CLI_DB_USERNAME'@'localhost' IDENTIFIED BY 'NR_CLI_DB_PASSWORD'; - GRANT REPLICATION CLIENT ON *.* TO 'NR_CLI_DB_USERNAME'@'localhost'; - GRANT SELECT ON *.* TO 'NR_CLI_DB_USERNAME'@'localhost'; + GRANT USAGE ON *.* to 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; + DROP USER 'NEW_RELIC_MYSQL_USERNAME'@'localhost'; + GRANT REPLICATION CLIENT, SELECT ON *.* TO 'NEW_RELIC_MYSQL_USERNAME'@'localhost' IDENTIFIED BY 'NEW_RELIC_MYSQL_PASSWORD'; EOT sudo sed -i 's/NR_CLI_DB_USERNAME/'$NR_CLI_DB_USERNAME'/g' /tmp/sql-create-user.sql