mysql 笔记
1 导入数据到远程数据库:
直接执行文件中 sql 语句
cmd> mysql -h 182.50.13.140 -u username -p databasename < "c:/tmp/da.sql"
进入 mysql 控制命令行
cmd> mysql -h 182.50.13.140 -u username -p
在命令行中导入本地数据文件,以 '#' 分割字段
mysql>load data local infile 'c:/tmp/renrentest.txt' into table dbname.renrentest fields terminated by '#'
如果您不指定 FIELDS 子句,则默认值为假设您写下如下语句时的值:
FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\'
mysqlimport 导入数据
cmd>mysqlimport -C -h 182.50.13.140 -u xxxx -p username -L c:/tmp/t.txt
参考:
http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#load-data
http://database.51cto.com/art/200510/8105.htm
http://blog.csdn.net/adparking/article/details/6676571