tenancy-docs/source/docs/v3/integrations/sail.blade.md
Chinmay Purav 46a2352885
Sail Separate integration docs added (#210)
* Sail Separate integration docs added

* old Laravel sail references hyperlinked to new page

* removed irrelevant default configuration

* custom credentials doc elaboration

* docs updated

* wip

* fixed issues in `sail.blade.md`

* used `>` in `configuration.blade.md`

* fixed typo for `:`

* Update source/docs/v3/quickstart.blade.md

* Update source/docs/v3/configuration.blade.md

* removed irrelevant pieces

* removed h2, added h1

* Update source/docs/v3/integrations/sail.blade.md

Co-authored-by: lukinovec <lukinovec@gmail.com>

* removal rollback

* Update the Sail integration guide

* Add guide for privilege granting automation

* trigger ci

---------

Co-authored-by: Chinmay Purav <experiment@webscientist.xyz>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: lukinovec <lukinovec@gmail.com>
2023-03-01 12:05:51 +01:00

1.3 KiB
Raw Blame History

title extends section
Laravel Sail integration _layouts.documentation content

Laravel Sail

Note: This guide covers Sail integration using MySQL. The steps described in the guide will need adjustments if you're using a database other than MySQL.

The default Sail user's name is determined by the DB_USERNAME variable in your .env. For this guide, we'll be using the username sail.

The default Sail user can only perform the create, read, update and delete operations in the central database. To allow the user to perform these operations in the tenant databases too, log in to Sail's MySQL shell as the root user (docker-compose exec mysql bash, then mysql -u root -p by default, the password is determined by the DB_PASSWORD variable in your .env) and grant the Sail user access to all databases by running the following statements:

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:

mysql:
    # ...
    volumes:
        # ...
        - 'PATH_TO_THE_SQL_FILE:/docker-entrypoint-initdb.d/SQL_FILE_NAME.sql'