数据入仓,解决Mysql导入csv中值变为00的问题

写入csv时,可能报错为
ERROR: invalid byte sequence for encoding “UTF8”: 0x00
建议:This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by “client_encoding”.
会导致出现问题的字段后面的数据无法写入csv,由此导致无法插入数据库
一种解决方案为在获取数据时:replace(ifnull(字段名称,’’),char(‘0x00’),’’) as 字段名

猜你喜欢

转载自blog.csdn.net/qq_22994783/article/details/83023909