mysql怎么導(dǎo)入txt數(shù)據(jù)?
發(fā)表時間:2023-07-22 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]對于大量的數(shù)據(jù)無法再用insert語句進行簡單插入,那么就需要使用特定的load語句把txt文檔中的數(shù)據(jù)進行載入。1.首先使用navicat在mysql數(shù)據(jù)庫建一個表(注意和txt數(shù)據(jù)的列對應(yīng)),數(shù)...
對于大量的數(shù)據(jù)無法再用insert語句進行簡單插入,那么就需要使用特定的load語句把txt文檔中的數(shù)據(jù)進行載入。
1.首先使用navicat在mysql數(shù)據(jù)庫建一個表(注意和txt數(shù)據(jù)的列對應(yīng)),數(shù)據(jù)庫和txt文件如下圖


2.找到MySQL Command Line Client,并打開


3.輸入密碼進入mysql,選擇表所在的數(shù)據(jù)庫:use 數(shù)據(jù)庫名

4.輸入加載txt數(shù)據(jù)的代碼:
load data infile ‘文件的絕對’ into table 表名,然后數(shù)據(jù)就導(dǎo)入了。


說明
注意txt文件和表的列要一致
以上就是mysql如何導(dǎo)入txt數(shù)據(jù)?的詳細內(nèi)容,更多請關(guān)注php中文網(wǎng)其它相關(guān)文章!
學(xué)習(xí)教程快速掌握從入門到精通的SQL知識。