Solutions ERROR 1231 (42000) – can’t be set to the value of ‘NULL’

Posted on

In this article, I will discuss one of the problems that solution ERROR 1231 (42000) – can’t be set to the value of ‘NULL’

Solutions ERROR 1231 42000
ERROR 1231 42000

ERROR 1231 (42000) at line 27482 in file: ‘/home/wps.sql’: Variable ‘character_set_client’ can’t be set to the value of ‘NULL’
Query OK, 0 rows affected (0.00 sec)

And this, perhaps a variation of the error:

ERROR 1231 (42000) at line 27484 in file: ‘/home/wps.sql’: Variable ‘collation_connection’ can’t be set to the value of ‘NULL’

The point has the same problem, in which the SQL file backup/mysqldump results are not included collation sets. The one where I know it determines the support of text formatting stored in the database table. So the required type is filled like UTF8, but the contents are even empty or NULL.

The solution I found was to edit the. sql file and directly handle it. Edit or add the following code:

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

So how to solve it, hopefully, help overcome ERROR 1231 (42000) – can’t be set to the value of ‘NULL’.