Home > Database > Mysql Tutorial > mysql数据导入与导出_MySQL

mysql数据导入与导出_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:51:52
Original
1268 people have browsed it

导出:

mysqldump -h hostname -u username -p password databasename (tablename) > filename

如从主机192.168.0.1(root/root)导出数据库Test到文件abc.sql

mysqldump -h 192.168.0.1 -u root -proot Test > abc.sql 

如果导单表,可以进一步指定表名,如导表pocky

mysqldump -h 192.168.0.1 -u root -proot Test pocky> abc.sql

导入:

mysql -h hostname -u username -p password

use databasename;

source filename

例如, 把abc.sql导入主机192.168.0.2(root/root)、数据库 Test2

mysql -h 192.168.0.2 -u root -proot

use Test2;

source abc.sql

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template