Insert into mysql from linux terminal -


i have question. can insert mysql database linux terminal record command:

mysql dbtest insert tablename values(1,"b","c") 

now have file in linux records example:

$cat file  2, "c", "e" 3, "r", "q" 4, "t", "w" 5, "y", "e" 6, "u", "r" 7, "g", "u" 8, "f", "j" 9, "v", "k" 

i don't know how can insert records file mysql database linux terminal.

i intent bash file don't know =(

doing series of inserts not best choice performance-wise. since input data exist csv you'd better off doing bulk load @kevin suggested:

mysql dbtest -e "load data infile './file' table tablename fields terminated ','" 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -