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 語句新增資料了。
相關文章
- QSocketNotifier: Socket notifiers cannot be enabled or disabled from another
- Property "visible" must be accessed with "$data.visible"
- SSH Server CBC Mode Ciphers Enabled漏洞修復Server
- bd_ticket_guard_client_dataclient
- Property "visible" must be accessed with "$data.visible" because properties
- MySQL client server 協議MySqlclientServer協議
- Bd-Ticket-Guard-Client-Data逆向client
- 【等待事件】SQL*Net more data to client事件SQLclient
- ECE4016 A simple Local DNS ServerDNSServer
- Client does not support authentication protocol requested by server; consider upgrading MySQL clientclientProtocolServerIDEMySql
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer
- Oracle 12C R2新特性-本地UNDO模式(LOCAL_UNDO_ENABLED)Oracle模式
- MySQL的文字匯入之load data localMySql
- Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'MySql
- Software-Defined Networking and Security From Theory to Practice (Data-Enabled Engineering).pdf ...
- A Unified Deep Model of Learning from both Data and Queries for Cardinality Estimation 論文解讀(SIGMOD 2021)Nifi
- client: c#+protobuf, server: golang+protobufclientC#ServerGolang
- 使用 LOAD DATA LOCAL INFILE,sysbench 導數速度提升30%
- [20180918]等待事件SQL/Net more data from client.txt事件SQLclient
- [20180925]等待事件SQLNet more data from client 6.txt事件SQLclient
- [20180922]等待事件SQLNet more data from client 4.txt事件SQLclient
- [20180920]等待事件SQLNet more data from client 3.txt事件SQLclient
- [20180926]等待事件SQLNet more data from client 7.txt事件SQLclient
- socket.io client + socketio-netty server簡析clientNettyServer
- Client Side Cache 和 Server Side Cache 的區別clientIDEServer
- 時區提示:Local time zone must be set--see zic manual page 2018的解決辦法
- Master of Both —— Trie的應用AST
- Connect SQL Server from Linux Client using Windows Authentication and troubleshoot stepsSQLServerLinuxclientWindows
- vue專案報錯[Vue warn]: Property “visible“ must be accessed with “$data.visible“ because properties startVue
- jQuery設定disabled屬性與移除disabled屬性jQuery
- 《初識TCP》iOS、macOS實現socket client與socket serverTCPiOSMacclientServer
- loading
- Table is specified twice, both as a target for 'UPDATE' and as a separate source
- Linguistics-English-Time is money + A coin has two sides.NGUIIDE
- 在 go websocket server 與 javascript websocket client 互動中使用 flatbuffersGoWebServerJavaScriptclient
- Loading ... done
- adb server version (31) doesn’t match this client (36); killing… 的解決方法Serverclient
- 高版本mysql訪問出現Client does not support authentication protocol requested by server;MySqlclientProtocolServer