From 8459b11019f310de30271fae026b5f1b19c4c641 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Sat, 5 Jun 2021 12:37:10 -0300 Subject: [PATCH] Allow database users to create/alter/drop routines (#3389) Database users may wish to create/alter/drop stored procedures on their databases in order to use extra MySQL functionality. --- app/Repositories/Eloquent/DatabaseRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Eloquent/DatabaseRepository.php b/app/Repositories/Eloquent/DatabaseRepository.php index 4e421df4..ab0bf709 100644 --- a/app/Repositories/Eloquent/DatabaseRepository.php +++ b/app/Repositories/Eloquent/DatabaseRepository.php @@ -107,7 +107,7 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor public function assignUserToDatabase(string $database, string $username, string $remote): bool { return $this->run(sprintf( - 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, LOCK TABLES, EXECUTE ON `%s`.* TO `%s`@`%s`', + 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, LOCK TABLES, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON `%s`.* TO `%s`@`%s`', $database, $username, $remote