mysql导入报错Variable 'sql_notes' can't be set to the value of 'NULL'

一、报错信息:

执行的SQL语句出错:

/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */

错误信息:Variable ‘sql_notes‘ can‘t be set to the value of ‘NULL‘

二、检查:

错误信息是说sql_notes不能设置为null值,登录检查如下

mysql> select @@sql_notes;
+-------------+
| @@sql_notes |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)

三、解释:

SQL_NOTES = {0 | 1}

当设置为1时(默认情况),“注意”一级的警报被记录下来。当设置为0时,“注意”警告被压制。Mysqldump包含输出,用于把此变量设置为0,这样,对于不会影响重新载入操作整体性的事件,重新载入转储文件时不会产生警告

四、解决:

mysql> set @@sql_notes=0;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@sql_notes;
+-------------+
| @@sql_notes |
+-------------+
|           0 |
+-------------+
1 row in set (0.00 sec)