我將csv文件內容放入數據庫。 當我手動運行下面的命令..它正常工作..但是當我在命令提示下單個查詢,它不運行。單個查詢命令
mysql -uuser -ppassword -hlocalhost -e "LOAD DATA INFILE "C:\csvfile.csv"
INTO TABLE test.LoadedEmployee FIELDS TERMINATED BY "," ENCLOSED BY ''
ESCAPED BY '\\' LINES TERMINATED BY "\n" STARTING BY ''"
FYI ..Manual語法這是工作:
mysql -uuser -ppassword -hlocalhost
LOAD DATA INFILE "C:\csvfile.csv" INTO TABLE test.LoadedEmployee
FIELDS TERMINATED BY "," ENCLOSED BY '' ESCAPED BY '\\'
LINES TERMINATED BY "\n" STARTING BY ''
你是什麼意思,當我手動運行...?如果你必須手動運行你正在使用命令promt儀式? – AnandPhadke
是的,我從命令提示符手動運行querry ...當我把querry放入一個腳本,然後嘗試運行該腳本時,它會拋出錯誤:錯誤在第1行:未知命令'\ n'。請幫助 – user1777416
您使用.bat文件來創建腳本? – AnandPhadke