Skip to content

Commit

Permalink
fix: Mysql 5.6 create user
Browse files Browse the repository at this point in the history
  • Loading branch information
noahmmcgivern committed Dec 14, 2023
1 parent 5e00811 commit f7e1171
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions recipes/newrelic/infrastructure/ohi/mysql/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions recipes/newrelic/infrastructure/ohi/mysql/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions recipes/newrelic/infrastructure/ohi/mysql/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f7e1171

Please sign in to comment.