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,JDBC的異常。經過長時間排查,排除了資料庫資料集的設定問題,排除了SQL語句的格式問題。最後發現是使用SQL Manager匯出的.sql檔案中有SQL語句的註釋,原來是這些註釋檔案造成以上的報錯。所以在執行類似的操作時,以後要記得刪除註釋語句後再執行批量SQL語句操作。
# SQL Manager 2007 Lite for MySQL 4.0.5.1
# ---------------------------------------
# Host : localhost
# Port : 3306
# Database : image
/*!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 */;
#
# Structure for the `imagefeatures1` table :
#
這些都要刪除掉,當然也可能是跟我使用的Java讀取語句有關係。Mark下,以後不要犯同樣的問題了。花了我大概一個小時時間找這個問題,傷不起啊!
相關文章
- mysql:Variable 'character_set_client' can't be set to the value of 'NULL'解決MySqlclientNull
- [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
- [Err] 1231 - Variable 'sql_mode' can't be set to the value of 'NULLSQLNull
- 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 '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
- 解決can't find -lGL的問題
- nginx upload 模組build錯誤解決error: variable ‘result’ set but not used [-Werror=unused-but-set-variable]NginxUIError
- Supervisor 解決 can't find command *
- Can't connect to X11 window server using DISPLAY variableServer
- Docker 容器中“TERM environment variable not set.”問題解決Docker
- cordova 解決can’t not find moudle " plugman platform ios"PlatformiOS
- couldn't set locale correctly報錯解決
- 解決Can not allocate log問題的方法
- 本機執行x程式出現:Can't open display 原因及其解決方法
- MySQL錯誤1042-Can't get hostname for your address解決方法MySql
- can't assign requested address 錯誤解決
- linux上“rman can't open target”問題解決Linux
- Can't use function return value in write context 使用empty遇到報錯FunctionContext
- MySQL 中出現報錯提示: ‘Variable ‘XXX‘ is a read only variable‘的解決方法MySql
- FileZilla:425 Can't open data connection for transfer of解決辦法
- MySQL問題記錄--Can't connect to MySQL server on localhost (10061)解決方法MySqlServerlocalhost
- cannot access local variable where it is not associated with a value
- 解決svnserve: Can't bind server socket: Address already in useServer
- Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist解決辦法ErrorMySql
- 解決Error (1133): Can’t find any matching row in the user tableError
- linux操作提示:“Can't open file for writing”或“operation not permitted”的解決辦法LinuxMIT
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)解決方法MySqlServer
- 問題解決zipimport.ZipImportError: can‘t decompress data; zlib not availablImportErrorAI
- 解決Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) "MySqlServer
- python報錯問題解決:'ascii' codec can't encode characterPythonASCII
- mysql解決Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.TimestampMySqlJava