From 8a8673cc270c00a3846c97ec117b4289666d1343 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 23 Nov 2022 10:52:32 +0100 Subject: [PATCH] Add guide for privilege granting automation --- source/docs/v3/integrations/sail.blade.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/docs/v3/integrations/sail.blade.md b/source/docs/v3/integrations/sail.blade.md index 2be2d91..e5f351e 100644 --- a/source/docs/v3/integrations/sail.blade.md +++ b/source/docs/v3/integrations/sail.blade.md @@ -16,3 +16,13 @@ The default Sail user can only perform the create, read, update and delete opera GRANT ALL PRIVILEGES on *.* to 'sail'@'%'; FLUSH PRIVILEGES; ``` + +You have to grant the privileges every time you re-run a container. To automate granting the privileges, create an SQL file with the previously mentioned SQL statements to grant all privileges to the Sail user. Then, add the path to the SQL file to `docker-compose.yml`'s MySQL volumes: + +```yml +mysql: + ... + volumes: + ... + - 'PATH_TO_THE_SQL_FILE:/docker-entrypoint-initdb.d/SQL_FILE_NAME.sql' +```