kalmanfans's Blog

模式识别 非线性预测 复杂网络 Following your heart

MySQL数据导入导出与备份

 
 
数据表数据导出为TXT、EXCEL格式
select CI,LAC,Longtitude,Latitude 
into outfile "c:/data_outchen.txt" 
lines terminated by "\r\n" 
from buf_20070918;
 
 
数据表数据导出为TXT、EXCEL格式
从TXT、EXCEL格式导入到数据库中。
use db4teletra;
CREATE TABLE  buf_20070918 (
  `R_ID` int(10) NOT NULL AUTO_INCREMENT,
  `CI` int(10) NOT NULL,
  `LAC` int(10) NOT NULL,
  `Longtitude` decimal(12,6) NOT NULL,
  `Latitude` decimal(12,6) NOT NULL,
  `Rechtswert_Y` decimal(12,3) NOT NULL,
  `Hochwert_X` decimal(12,3) NOT NULL,
  `Azimuth` int(10) DEFAULT NULL,
  `Sectorangle` int(10) DEFAULT NULL,
  `Repeater` int(10) DEFAULT NULL,
  PRIMARY KEY (`R_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=6755 DEFAULT CHARSET=utf8;
 
use database_name;
load data local infile "c:/buf20070918.txt"
into table buf_20070918(CI, LAC, Longtitude, Latitude, Rechtswert_Y, Hochwert_X, Azimuth, Sectorangle, Repeater);
 
 
数据表数据导出为SQL语句
mysqldump -u root -p tele_tra_db buf_20070918 > dumpbuf.txt password mysql
 
 
数据库备份