mysql:Variable 'character_set_client' can't be set to the value of 'NULL'解決
開發專案時遇到一個問題,並沒有使用儲存過程來批量執行SQL語句。而是在Java業務處理過程中將.sql檔案中的批量SQL語句分條讀取,讀取後一條一條執行。原先的.sql檔案是使用SQL Manager匯出的,需要在專案部署的時候將匯出的.sql檔案重新部署到新的客戶端電腦上,所以需要進行批量執行SQL語句的操作。好進入正題:
在批量執行的過程中遇到Variable ‘character_set_client’ can’t be set to the value of Null的SQL。經過長時間排查,排除了資料庫資料集的設定問題,排除了SQL語句的格式問題。最後發現是使用SQL Manager匯出的.sql檔案中有SQL語句的註釋,原來是這些註釋檔案造成以上的報錯。所以在執行類似的操作時,以後要記得刪除註釋語句後再執行批量SQL語句操作。
指令碼開始:
-- phpMyAdmin SQL Dump
-- version 3.5.5
-- http://www.phpmyadmin.net
--
-- 主機: 10.236.158.100:7013
-- 生成日期: 2015 年 06 月 23 日 14:55
-- 伺服器版本: 5.5.24-CDB-3.0.0-log
-- PHP 版本: 5.3.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!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 */;
--
-- 資料庫: `WeiJu_1`
--
指令碼最後:
/*!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 */;
相關文章
- Variable 'character_set_client' can't be set to the value of Null的解決方法clientNull
- [mysql] 批量匯入提示: Variable ‘character_set_client’ can’t be set to the value of ‘NULLMySqlclientNull
- mysql遇到Variable can’t be set to the value of ‘NULL’MySqlNull
- Mysql:Variable 'XXXt' can't be set to the value of 'NULL'解決MySqlNull
- 解決問題:Variable 'time_zone' can't be set to the value of 'NULL'Null
- mysql匯入報錯Variable 'sql_notes' can't be set to the value of 'NULL'MySqlNull
- [Err] 1231 - Variable 'sql_mode' can't be set to the value of 'NULLSQLNull
- [ERR] 1231 - Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'SQL
- 完美解決stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.ErrorPython
- Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.Server
- 解決ERROR 1231 (42000): Variable 'time_zone' can'tError
- 錯誤解決:Attempting to use uninitialized value VariableZed
- nginx upload 模組build錯誤解決error: variable ‘result’ set but not used [-Werror=unused-but-set-variable]NginxUIError
- 解決Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "MySqlServer
- Supervisor 解決 can't find command *
- 解決can't find -lGL的問題
- Can't connect to X11 window server using DISPLAY variableServer
- Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist解決辦法ErrorMySql
- Docker 容器中“TERM environment variable not set.”問題解決Docker
- cordova 解決can’t not find moudle " plugman platform ios"PlatformiOS
- couldn't set locale correctly報錯解決
- mysql解決Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.TimestampMySqlJava
- MySQL問題記錄--Can't connect to MySQL server on localhost (10061)解決方法MySqlServerlocalhost
- 【linux】Can't connect to MySQL server on 'XXX' (13)問題解決方式LinuxMySqlServer
- MySQL錯誤1042-Can't get hostname for your address解決方法MySql
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解決方法MySqlServer
- [ERROR] Can't open the mysql.plugin tableErrorMySqlPlugin
- mysql can't start dues to the disk space is fullMySql
- can't assign requested address 錯誤解決
- linux上“rman can't open target”問題解決Linux
- Can't use function return value in write context 使用empty遇到報錯FunctionContext
- mysql [ERROR] Can't create IP socket: Permission deniedMySqlError
- FileZilla:425 Can't open data connection for transfer of解決辦法
- cannot access local variable where it is not associated with a value
- MySQL_ERROR 1231 (42000) at line XX in file 'file_name' Variable 'time_zone' can't beMySqlError
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- 解決svnserve: Can't bind server socket: Address already in useServer