spatie / laravel-backup

A package to backup your Laravel app

Home Page:https://spatie.be/docs/laravel-backup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQL useSingleTransaction option not working?

Adam-78 opened this issue · comments

I have laravel 9 using spatie laravel-backup version 8.1.7 with a MySQL 8 database.

In my database.php I have added the dump key with option useSingleTransaction as follows but the generated dumpfile is still including LOCK statements e.g. LOCK TABLES accreditations WRITE; despite all tables being innodb. Below is my configuration in database.php file.

'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'forge'),
        'username' => env('DB_USERNAME', 'forge'),
        'password' => env('DB_PASSWORD', ''),
        'unix_socket' => env('DB_SOCKET', ''),
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
        'prefix' => '',
        'strict' => false,
        'engine' => 'InnoDB',
        'options' => extension_loaded('pdo_mysql') ? array_filter([
            PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            PDO::MYSQL_ATTR_LOCAL_INFILE => true
        ]) : [],
        'dump' => [
            'useSingleTransaction' => true,
        ],
],

I also tried adding key 'skipLockTables' => true, to the dump key in addition to the above but even that makes no difference? is there something else i need to configure which i'm missing?