导出:
mysqldump -h hostname -u username -p password databasename (tablename) > filename
如从主机192.168.0.1(root/root)导出数据库<meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />Test到文件abc.sql
<meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />mysqldump -h <meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />192.168.0.1 -u root -proot <meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />Test > <meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />abc.sql
如果导单表,可以进一步指定表名,如导表pocky
<meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />mysqldump -h 192.168.0.1 -u root -proot Test <meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />pocky> abc.sql
导入:
mysql -h hostname -u username -p password
use databasename;
本文来源gao!%daima.com搞$代*!码$网3
source filename
例如,<meta content=”text/html; charset=utf-8″ http-equiv=”content-type” /> 把abc.sql导入主机192.168.0.2(root/root)、数据库 Test2
<meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />
mysql -h <meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />192.168.0.2 -u root -proot
use <meta content=”text/html; charset=utf-8″ http-equiv=”content-type” />Test2;
source abc.sql