supermooshman's avatar

Charset problem during migration

Hi all,

while I'm quite new with Laravel (my first project), I seem to have stumbled upon an issue which I've been looking at for way too long

'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [

        'sqlite' => [
            /* shortened as it is not used - default settings were kept */
        ],

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', 'myhost.com'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'mypassword'),
            'username' => env('DB_USERNAME', 'myusername'),
            'password' => env('DB_PASSWORD', 'clowb4jx6vn99x4m'
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'strict' => true,
            'engine' => null,
        ],

        'pgsql' => [
        /* shortened as it is not used - default settings were kept */
        ],

    ],

This gives me following output:

~/path/to/approot/ $ php artisan migrate
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Parse error: syntax error, unexpected ''charset'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in /home/path/to/approot/config/database.php:62
Stack trace:
#0 /home/path/to/approot/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(38): Illuminate\Foundation\Bootstrap\LoadConfiguration->loadConfigurationFiles(Object(Illuminate\Foundation\Application), Object(Illuminate\Config\Repository))
#1 /home/path/to/approot/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(Object(Illuminate\Foundation\Application))
#2 /home/path/to/approot/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(262): Illuminate\Foundation\Application->bootstrapWith(Array)
#3 /home/path/to/approot/v in /home/vincent/Documents/development/laravel/panapp/config/database.php on line 62

While it seems clear that the issue lies with the charset, I have no clue what it should be? Anyone wants to take a gander?

  • my database is a JawsDB MySQL hosted on Heroku
0 likes
0 replies

Please or to participate in this conversation.