MySQL Import txt data
Cases:
Create Schema Foursquare_nyc;use foursquare_nyc;create table checkins (userid int not null auto_increment, originid VA Rchar (+), LocationID varchar (+), x double, y double, primary key (UserID)), load data local infile "E:/dataset_ubi Comp2013_raw_checkins.txt "into Table Checkins (originid,locationid,x,y);
By default, \ n is delimited for each set of data, and \ t is delimited for each data, and if not, the
Load data local infile "e:/dataset_ubicomp2013_raw_checkins.txt" into Table Checkins (originid,locationid,x,y) fields Terminated by ' * * * ' lines terminated by ' * * *;
1) The file can use an absolute path such as ' c:/d.txt ', otherwise put the file in the database root directory.
2) Because Windows lines are ' \ r \ n ' separated, they must be lines terminated by ' \ r \ n ',
If you do not set this parameter, you can also import the success, but will import a "\ r" control character, may not be visible in the visual MySQL tool field, but the MySQL command line display will be obvious confusion.
MySQL export database is. sql
Cases:
Command line E:\Program files\mysql\mysql Server 5.5\bin>mysqldump-u root-p database name > generate file name. sql
The table for the MySQL export database is. sql
Cases:
Command line E:\Program files\mysql\mysql Server 5.5\bin>mysqldump-u root-p database name Table name > generate file name. sql
MySQL Import txt data and export the entire database or a table of the database method