Browse Source

fix mysql permissions (#2388)

pull/2389/head
Jason Dove 4 months ago committed by GitHub
parent
commit
d80c6737a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 22
      ErsatzTV.Infrastructure/Data/DbInitializer.cs

4
CHANGELOG.md

@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix transcoding content with bt709/pc color metadata
- Fix scripted schedule validation (file exists) when creating or editing playout
- Fix adding single episode, movie, season, show to empty playlists
- Fix startup with MySql as non-superuser
- `local_infile=ON` is required when using MySQL (for bulk inserts when building playouts)
- ETV will set this automatically when it has permission
- When ETV does not have permission, startup will fail with logged instructions on how to configure MySql
### Changed
- **BREAKING CHANGE**: change how `Scripted Schedule` system works

22
ErsatzTV.Infrastructure/Data/DbInitializer.cs

@ -15,7 +15,27 @@ public static class DbInitializer @@ -15,7 +15,27 @@ public static class DbInitializer
}
else
{
await context.Connection.ExecuteAsync("SET GLOBAL local_infile = true", cancellationToken);
int localInfile = await context.Connection.ExecuteScalarAsync<int>(
"SELECT @@GLOBAL.local_infile");
if (localInfile == 0)
{
try
{
await context.Connection.ExecuteAsync("SET GLOBAL local_infile = 'ON'", cancellationToken);
}
catch
{
Serilog.Log.Fatal(
"""
ErsatzTV requires local_infile=ON when using MySQL.
Please run the following as a MySQL administrator:
SET GLOBAL local_infile = 'ON';
Or configure it in my.cnf under [mysqld].
""");
throw;
}
}
}
if (!context.LanguageCodes.Any())

Loading…
Cancel
Save