Migration issue
Closed this issue · 1 comments
Hi,
I was following the install instructions on the wiki but ran into the following issue when I tried to create a new database with 'php artisan migrate --seed'.
Thanks in advance for any help you are able to provide.
The error is as follows:
Migrating: 2018_12_08_002558_create_views_and_functions
Illuminate\Database\QueryException
SQLSTATE[HY000]: General error: 1418 This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable) (SQL: CREATE
FUNCTION actor_list
(mid INT, arole TEXT) RETURNS text CHARSET utf8
BEGIN
DECLARE alist TEXT;
SELECT GROUP_CONCAT(actor.name ORDER BY mal.display_order) INTO alist FROM matter_actor_lnk mal
JOIN actor ON actor.ID = mal.actor_ID
WHERE mal.matter_ID = mid AND mal.role = arole;
RETURN alist;
END)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678
674▕ // If an exception occurs when attempting to run a query, we'll format the error
675▕ // message to include the bindings with SQL, which will make this exception a
676▕ // lot more helpful to the developer instead of just the database's errors.
677▕ catch (Exception $e) {
➜ 678▕ throw new QueryException(
679▕ $query, $this->prepareBindings($bindings), $e
680▕ );
681▕ }
682▕
+10 vendor frames
11 database/migrations/2018_12_08_002558_create_views_and_functions.php:58
Illuminate\Support\Facades\Facade::__callStatic()
+21 vendor frames
33 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Your phpip user does not have sufficient permissions on the database. In any case, you probably need to set the variable log_bin_trust_function_creators
to "true". This is a constraint that has appeared in MySQL 8.
Execute the following in the MySQL console:
SET GLOBAL log_bin_trust_function_creators = 1;
Add the following to the mysql.ini configuration file:
log_bin_trust_function_creators = 1;