Categories

SQLSTATE 42000: Syntax error or access violation – Laravel Solved

Have you ever get SQLSTATE 42000 error in PHP, Yes of course this error occurs several time when you’re using PDO connection in PHP. And in this article i’m going to cover why this error occurs in Laravel and how to solve in this error in laravel framework.

Why this error occurs in Laravel?

In Laravel 5.4 and above the default database character set is changed to utf8mb4 which supports for the storing of Emojis. This error occurs on MySQL version less than 5.7.7 and MariaDB version less than 10.1 and higher you do not need to do anything.