smilly92
smilly92

Reputation: 2443

MySQL error unknown collation

After attempting to run a migration in Laravel 4 I received the following error:

[PDOException]                                              
SQLSTATE[HY000]: General error: 1273 Unknown collation: ''

Here is my database connection configuration;

'mysql' => array(
    'driver'   => 'mysql',
    'host'     => 'localhost',
    'unix_socket'   => '/Applications/MAMP/tmp/mysql/mysql.sock',
    'database' => 'database',
    'username' => 'root',
    'password' => 'root',
    'charset'  => 'utf8',
    'prefix'   => '',
),

Any suggestions?

Upvotes: 1

Views: 4133

Answers (1)

mogetutu
mogetutu

Reputation: 508

Grab the latest source code by running composer update from the root folder of your installation. Else update your array as below.

'mysql' => array(
    'driver'   => 'mysql',
    'host'     => 'localhost',
    'unix_socket'   => '/Applications/MAMP/tmp/mysql/mysql.sock',
    'database' => 'database',
    'username' => 'root',
    'password' => 'root',
    'charset'  => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'   => '',
 ),

Upvotes: 8

Related Questions