在Windows操作系統下,使用命令行將已經創建好的txt文件導入到mysql的pet表中。
出現ERROR 1148 (42000): The used command is not allowed with this MySQL version。
輸入命令:show variables like 'local_infile';
顯示 local_infile是關閉的,輸入語句:set global local_infile=ON; 將local_infile打開。(如果報錯,無法修改,則需登陸root用戶進行修改)
然后退出當前用戶,用以下語句登陸:mysql --local-infile -u username -p,再輸入導入數據的語句則可以成功導入。