Home > Database > Mysql Tutorial > linux系统中mysql数据库的导入和导出_MySQL

linux系统中mysql数据库的导入和导出_MySQL

PHP中文网
Release: 2016-05-27 13:45:22
Original
1324 people have browsed it

linux系统中mysql数据库的导入和导出_MySQL

目的:将服务器的mysql中的数据导入到本地

设备:本地:Mac。 远程服务器:linux

使用ssh登录服务器

mysqldump -u [username] -p [database_name] > [/path/dumpfilename.sql]
Copy after login

例如:

`mysqldump -u root -p mywordpress > /var/mywordpress.sql
Copy after login

在Mac上使用软件filezilla将第2步导出的mywordpress.sql下载到本地

mysql -u [username] -p [database_name] < [dumpfilename.sql]
Copy after login

其中,database_name需要是本地数据库中已存在的数据库,比如新建一个。

以上就是linux系统中mysql数据库的导入和导出_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!


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