multi-tenant icon indicating copy to clipboard operation
multi-tenant copied to clipboard

Add support for MySQL authentication plugins configuration

Open geodro opened this issue 5 years ago • 1 comments

Description of your feature

If we use managed databases from DigitalOcean, they support only caching_sha2_password as auth plugin for mysql. We should add in config the option of what auth plugin tenancy should use.


Proposed behavior

Hyn\Tenancy\Generators\Webserver\Database\Drivers\MariaDB:42

return $connection->statement("CREATE USER IF NOT EXISTS {$config['username']}@'{$config['host']}' IDENTIFIED WITH {$config['auth_method']} BY {$config['password']}'");

where auth_method should be mysql_native_password or caching_sha2_password

Current behavior

Hyn\Tenancy\Generators\Webserver\Database\Drivers\MariaDB:42

return $connection->statement("CREATE USER IF NOT EXISTS {$config['username']}@'{$config['host']}' IDENTIFIED BY '{$config['password']}'");

Information

  • hyn/multi-tenant version: 5.5
  • laravel version: ^5.8

geodro avatar Jan 03 '20 15:01 geodro

If you could, please create a Pull Request with some tests so we're sure nothing breaks.

Plytas avatar Jan 30 '20 21:01 Plytas