MySQL ERROR 1231 (42000):Variable 'character_set_client' can't be set to the value of 'NULL'

I did some search in internet and fixed it finally.

Added the following text at the beginning of the mysqldump file and the restore was successful.

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

I have modified

/*!40101 SET character_set_client = @saved_cs_client */;

to

/*!40101 SET character_set_client = 'utf8' */;

in the dump file after the code for creating table.


Try to make the maximum allowed packet size arbitrarily high temporarily by typing in:

mysql> set global max_allowed_packet=10000000000;

/via http://injustfiveminutes.com/2013/02/14/errors-restoring-mysql-database-dump-on-wamp-environment/

Tags:

Mysqldump