Home > Database > Mysql Tutorial > body text

mysql数据导入与导出_MySQL

WBOY
Release: 2016-06-01 13:51:52
Original
1178 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:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!