报错内容
使用mysqldump 备份数据库导入报如下错误
mysql> source /root/test.sql
...省略...
ERROR 1231 (42000): Variable 'character_set_client' can't be set to the value of 'NULL'
...省略...
解决方案
在sql文件末尾注释该条sql语句,前面加#号或删除
[root@rocky01 ~]# vim /root/test.sql
#原
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
#注释后
#/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
补充
MySQL Server针对C风格的注释在解析上做了一些扩展,当注释满足如下风格时,MySQL Server将会解析并执行注释中的代码
/*! MySQL-specific code */
标签:...,SET,1231,CLIENT,CHARACTER,character,set,sql From: https://www.cnblogs.com/Willoneday/p/16861648.html