I have the latest Laravel 5.4, and running on the latest Homestead 2.0 (with MySQL 5.7.12).
This is my 1.sql file (replaced from the actual database):
select now();
I am trying to run this command:
DB::unprepared(file_get_content(storage_path('import/1.sql')));
Laravel keeps throwing this error:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to >your MySQL server version for the right syntax to use near 'select now()' at line 1 (SQL: select now();)
As I notice, no matter what's in 1.sql, Laravel throws the error. When import the actual .sql file, Laravel imports it without error.
Any solutions?
via Santosh Achari