Open josecelano opened 8 years ago
I am not sysadmin so I have fixed it quickly and not very well :-) (this should be done in homestead.yml or elsewhere):
Change mysql config file:
...
lc-messages-dir = /usr/share/mysql
sql-mode = "allow_invalid_dates"
explicit_defaults_for_timestamp
...
Add line sql-mode = "allow_invalid_dates"
sudo vi /etc/mysql/my.cnf
add the line ....
sudo service mysql restart
IMPORTANT: If you run
vagrant provision
that configuration will be lost.
There is also this post about removing the mysql strict config: https://mattstauffer.co/blog/how-to-disable-mysql-strict-mode-on-laravel-forge-ubuntu
OK thanks @nWidart . Maybe you can include this:
In Laravel, you can fix this in code: edit your database.php config file, and add a key of strict with a value of false. But if you're using a non-Laravel application (we've run into this with both CodeIgniter and CraftCMS applications), you won't have that option. Here's how to disable strict mode globally on any Laravel Forge server (and any other Ubuntu server).
in the project config/database.php
file, if the project needs it. But I do not know if that could be a problem in others systems where that can not be changed dinamically. I have read somewhere change that config option is a decrepated feature in latest MySQ (but and not sure and I do not know how Laravel does it).
I fixed this by changing: config/database.php as below:
'mysql' => [
'driver' => 'mysql',
...
'strict' => true, // change false to true
],
When I run
php artisan migrate
I get this error:And it seems to be this one:
https://github.com/laravel/framework/issues/3602
I think my homestead version does not allow to create the table because MySQL config does not allow it.
I have to found out what solution they consider the best.