From 234f920bd3aff841db29470d5d61b607da19fa3c Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Sat, 10 Sep 2022 03:52:07 -0500 Subject: [PATCH] Checking in a sql script for generating a new gemp user --- gemp-lotr/db/recreate-secure-user-for-database.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 gemp-lotr/db/recreate-secure-user-for-database.sql diff --git a/gemp-lotr/db/recreate-secure-user-for-database.sql b/gemp-lotr/db/recreate-secure-user-for-database.sql new file mode 100644 index 000000000..39c447229 --- /dev/null +++ b/gemp-lotr/db/recreate-secure-user-for-database.sql @@ -0,0 +1,10 @@ + +DROP USER 'gempuser'@'localhost'; + +#Once you have ran this script, make sure that you alter the credentials used in gemp-lotr-common/.../gemp-lotr.properties, or else the server will crash on startup. +#It is highly recommended you run this script (obviously with a better user/password) on any production database. The default one is in the code base, after all. +#Also recommend once you do so to avoid checking in the gemp-properties into git, which can be performed with the following command: +# git update-index --assume-unchanged ./gemp-lotr/gemp-lotr-common/src/main/resources/gemp-lotr.properties +CREATE USER 'some-other-username'@'172.28.1.2' IDENTIFIED BY 'a-really-secure-password'; +GRANT USAGE, SELECT, INSERT, UPDATE, DELETE ON gemp_db.* TO 'some-other-username'@'172.28.1.2' WITH GRANT OPTION; +FLUSH PRIVILEGES; \ No newline at end of file