/ Published in: SQL
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# export STRUCTURE ONLY (no DATA) AS SQL mysqldump -u root -pthePasssword --no-data theDbName > mydata.sql # export WITH DATA AS SQL mysqldump -u root -pthePasssword --default-character-set=latin1 --skip-set-charset theDbName > mydata.sql # import SQL mysql -u root -pthePasssword -D theDbName < mydata.sql # export DATA AS a comma separated VALUES document SELECT * INTO OUTFILE '/tmp/mydata.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM mydata; # import DATA FROM a comma separated VALUES document LOAD DATA LOCAL INFILE '/tmp/mydata.csv' INTO TABLE mydata FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';