Home >Backend Development >PHP Tutorial >thinkphp sets DB_CHARSET to utf8mb4
tp3.2.3 database configuration 'DB_CHARSET'=> 'utf8mb4', execution error. As follows
<code>SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) 错误位置 FILE: /data1/www/htdocs/733/ecampus/3/ThinkPHP/Library/Think/Db/Driver.class.php LINE: 109 </code>
If you don’t use tp, you can use native sql ‘set names utf8mb4’ and it will execute without any problem.
What went wrong? Please fix it! Thank you!