Home>Article>PHP Framework> laravel database migration error
(1) Laravel 5.4 or later has changed the default database character set, and now utf8mb4 includes support for storing emojis. If you are running MySQL v5.7.7 or higher, you don't need to do anything.
(2) When you try to run the migrations command on some MariaDB or some older versions of MySQL, you may encounter the following error:
Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
[The specified key is too long, the maximum key length is 767 bytes, because the default string length of laravel is 767 bytes, so you have to configure it manually. 】
For more Laravel related technical articles, please visit theLaravel Tutorialcolumn to learn!
The above is the detailed content of laravel database migration error. For more information, please follow other related articles on the PHP Chinese website!