top-think/think-migration

An invalid encoding was specified for SQLSRV_ATTR_ENCODING

liuzhengjian opened this issue · 0 comments

think-migration version: 1.*
thinkphp version: 5.0.13

使用sqlsrv报错 SQL Server fails with SQLSTATE[IMSSP]: An invalid encoding was specified for SQLSRV_ATTR_ENCODING.

官方解决方法应该去除charset设置,应该在Command.php的getDbConfig方法返回数据之前增加
if($config['type'] == 'sqlsrv'){ unset($dbConfig['charset']); }