问题
I am trying to follow a tutorial about the basics of Databases and i am at the part of setting up Sentry 2. I added all the exceptions as requested. But on step four of the documentation page on the Sentry 2 website. I am getting the following error
{"error":{"type":"ErrorException","message":"Undefined index: collation","file":"\/var\/www\/db_test\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connectors\/MySqlConnector.php","line":22}}
I tried a few things as noted in my ssh screen but nothing:
robert@Devlopement:/var/www/db_test$ php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing cartalyst/sentry (dev-master 9a8221d)
Downloading: 100%
Writing lock file
Generating autoload files
Generating optimized class loader
Compiling common classes
robert@Devlopement:/var/www/db_test$ php artisan key:generate
Application key [Dabb88Fw5080yq53cYgyprredmPbVBpK] set successfully.
robert@Devlopement:/var/www/db_test$ php artisan migrate --package=cartalyst/sentry
{"error":{"type":"ErrorException","message":"Undefined index: collation","file":"\/var\/www\/db_test\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connectors\/MySqlConnector.php","line":22}}robert@Devlopement:/var/www/db_test$ phptrytisan migrate --package=cartalyst/sen
{"error":{"type":"ErrorException","message":"Undefined index: collation","file":"\/var\/www\/db_test\/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Connectors\/MySqlConnector.php","line":22}}robert@Devlopement:/var/www/db_test$ ^C
robert@Devlopement:/var/www/db_test$
I Google the problem and it seems like it was an issue that was suppose to be resolved in beta. Any ideas?
回答1:
Your database config is broken. In app/config/database.php is a list of configured databases. Yours is most likely missing 'collation' in your config.
来源:https://stackoverflow.com/questions/17538609/laravel-4-php-artisan-migration-not-working