From addb2a38c45ed90c968b0ed24f336e08e402a64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Wamej?= Date: Tue, 22 Jun 2021 15:10:45 +0200 Subject: [PATCH] create SQL users explicitly As [MySQL 5.7 docs on GRANT](https://dev.mysql.com/doc/refman/5.7/en/grant.html) state: > However, use of GRANT to create accounts or define nonprivilege characteristics is deprecated in MySQL 5.7. Instead, perform these tasks using CREATE USER or ALTER USER. --- setup/productionize/persistence/orca-sql.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup/productionize/persistence/orca-sql.md b/setup/productionize/persistence/orca-sql.md index 9497ec5ac9..036ceaa524 100644 --- a/setup/productionize/persistence/orca-sql.md +++ b/setup/productionize/persistence/orca-sql.md @@ -38,16 +38,20 @@ set tx_isolation = 'READ-COMMITTED'; ```sql CREATE SCHEMA `orca` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + + CREATE USER + 'orca_service'@'%', -- IDENTIFIED BY "password" if using password based auth + 'orca_migrate'@'%'; -- IDENTIFIED BY "password" if using password based auth GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, EXECUTE, SHOW VIEW ON `orca`.* - TO 'orca_service'@'%'; -- IDENTIFIED BY "password" if using password based auth + TO 'orca_service'@'%'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, LOCK TABLES, EXECUTE, SHOW VIEW ON `orca`.* - TO 'orca_migrate'@'%'; -- IDENTIFIED BY "password" if using password based auth + TO 'orca_migrate'@'%'; ``` When Orca starts up, it will perform database migrations to ensure its running the correct schema.