导出:mysqldump -u用户名 -p密码 -hIP地址 数据库名 > /dump.sql示例:mysqldump -uroot -proot -h127.0.0.1 test > /test.sql将test库中所有的表和数据导入test.sql文件中。
导入:source 导入数据的文件地址示例:source /test.sql导入数据时需要先连上数据库,use数据库,再进行导入数据。