ERROR3948: Loading local data is disabled - this must be enabled on both the client and server sides
在mysql 8.0.22 執行load data local 從本地文字匯入資料時,報錯:"ERROR 3948(42000): Loading local data is disabled - this must be enabled on both the client and server sides".
結合官方文件和Stack Overflow上的解釋,得到以下最佳的解決方案,如下:
step1.首先,檢查一個全域性系統變數 'local_infile' 的狀態:
show global variables like 'local_infile';
如果得到如下顯示 Value=OFF,則說明這是不可用的。如果得到的是 Value=ON,請直接跳往 step3
step2.要把這個值變為 ON,這裡找到兩種方法:
第一種方法:
1).在mysql客戶端輸入:
set global local_infile=1;
2).然後退出quit 退出mysql。再次進入時,便會出現 Value=ON
第二種方法:
1).在 C:\ProgramData\MySQL\MySQL Server 8.0(此處為Windows10系統) 路徑下,找到初始化檔案 my.ini,開啟
2).找到以 [client], [mysql], [mysqld] 開頭的三處位置,在每處的下面加一行 local_infile=ON,儲存更改
3).重啟mysql伺服器後,同樣會得到預期的結果
但是,至此問題還沒有解決
step3.在進入資料庫的命令列要加上 --local_infile=1 這個配置,具體如下:
mysql --local_infile=1 -u <username> -p
這個時候,就可以開開心心的執行 load data local 語句新增資料了。
相關文章
- How to Check whether SELinux is Enabled or Disabled [ID 432988.1]Linux
- View Client with Local Mode簡述薦Viewclient
- Data Loading with External Tables (172)
- TA263:The client is locked for data import by client copyclientImport
- boot VMware server no found local?bootServer
- Entity Framework Tutorial Basics(35):Local DataFramework
- SQL*Net more data from clientSQLclient
- bd_ticket_guard_client_dataclient
- SSH Server CBC Mode Ciphers Enabled漏洞修復Server
- MySQL client server 協議MySqlclientServer協議
- 關於RAC 的Data Guard中FAL_SERVER及FAL_CLIENT的設定Serverclient
- 【等待事件】SQL*Net more data to client事件SQLclient
- SDU&SQL*NET MORE data to clientSQLclient
- Bd-Ticket-Guard-Client-Data逆向client
- Data Server ScriptsServer
- Oracle 12C R2新特性-本地UNDO模式(LOCAL_UNDO_ENABLED)Oracle模式
- SQL* Net message to client 和SQL * Net more data to client等待事件SQLclient事件
- Property "visible" must be accessed with "$data.visible"
- The innodb_system data file 'ibdata1' must be writable
- How to Rename a Server That Is Not a Data Store ServerServer
- Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'MySql
- MySQL的文字匯入之load data localMySql
- Should i install mail server on local machine?AIServerMac
- 00017: Data frame has at least one annotation group that is enabled and contains graphicsASTAI
- Your password has expired. To log in you must change it using a client that supports expired passworclient
- 使用Virtual Infrastructure Client 管理 VMWare ServerASTStructclientServer
- Introduction to Client/Server Architecture (273)clientServer
- Java 在Client/Server 中應用JavaclientServer
- Property "visible" must be accessed with "$data.visible" because properties
- 《Client-Server Web Apps with JavaScript and Java》選讀:什麼是Client-Server Web App?clientServerWebAPPJavaScript
- The server has encountered an error while loading an applicationServerErrorWhileAPP
- ECE4016 A simple Local DNS ServerDNSServer
- jQuery :enabledjQuery
- client: c#+protobuf, server: golang+protobufclientC#ServerGolang
- SUSE 11 NFS server/client 安裝配置NFSServerclient
- IIS與oracle client ,還是oracle server ?OracleclientServer
- mysql原碼安裝(server和client)MySqlServerclient
- Oracle client/server architecture's benefits (275)OracleclientServer