MySQL错误1231(42000):变量'character_set_client'不能设置为'NULL'的值 [英] MySQL ERROR 1231 (42000):Variable 'character_set_client' can't be set to the value of 'NULL'

查看:1028
本文介绍了MySQL错误1231(42000):变量'character_set_client'不能设置为'NULL'的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Slackware 13.0 Staging服务器上运行的MySQL 5.0.84,想要将一个表复制到另一台服务器上,该服务器是使用Ubuntu 14.04 OS构建的,用于其他测试.我已获取该表的mysqldump并复制到了testing server.尝试还原转储文件时出现以下错误.

I've a MySQL 5.0.84 running in a Slackware 13.0 Staging server and wanted to copy a single table to another server which was built to use Ubuntu 14.04 OS for some other testing. I've taken a mysqldump of that table and copied to the testing server. I get the following error when I try to restore the dump file.

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

请帮助我解决此错误.谢谢!

Please help me how to fix this error. Thanks!

推荐答案

我在互联网上进行了一些搜索,并最终进行了修复.

I did some search in internet and fixed it finally.

在mysqldump文件的开头添加了以下文本,还原成功.

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 */;

这篇关于MySQL错误1231(42000):变量'character_set_client'不能设置为'NULL'的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆