mysql select / insert into / from file

Select Into file

mysql -h 主機 -u 用戶 -p密碼 -P端口 -D庫 -Bse “select id,type from table;”  > /var/sql.txt

Insert from file

local data offloading is disabled by default , and for the file to be read into the database, it must be enabled by starting mysql using

mysql -uroot -ppassword --local-infile database

# move the file into the database directory
mv sql.txt to /var/lib/mysql/database/
mysql> Load Data InFile 'sql.txt' Into Table `table`;



To be continue...
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章