mysql 数据导入导出

导出数据

mysqldump  -uroot -proot mydatabase mytable  >  /home/user/mysql.sql

导入数据:

mysql -uroot -proot mydatabase < /home/user/mysql.sql

或者

登陆mysql之后

use mydatabase; source /home/user/mysql.sql

或者

select username,email from mytabal order by user_id into outfile “/home/user/mysql.sql”; load data infile “/home/user/mysql.sql” into table tabelname1(fieldname);

Hibbs

0