简体   繁体   中英

How to backup a MySQL database?

I have an account on an organizational MySQL server that is about to expire. I have a couple of databases on this server and would like to know how to backup (mirror) the their schemas and all data in them to my local hard drive (not to another MySQL server because I'd rather not have to set one up). Is there a free tool that I can use to do this backup quickly and easily? (It has to support connecting securely and over an SSH connection.) Thanks for your help.

是的, MySQLdump

mysqldump -u your-username -p database_name > filename

This is exactly the sort of thing that mysqldump is intended for. Just SSH into the server, run mysqldump, and scp off your output file.

You could manually SSH to the server and run a mysqldump, but I don't think that's what you're asking about.

Personally, I'd use a program like SQLyog on Windows or Sequel Pro on Mac. Both support SSH tunneling and both have a very easy interface for mysql backups/exports.

您可以使用mysqldump来完成工作。

In the control panel lookup for database tools, lick mysqladmin. Once you are there, you can back up a table, an entire database or what ever you want. There are checkbooks like do you want to export database structure only or the data too. There is bunch of options there, all GUI based. Please explore, you do not need command line.

Once you are done exporting, you can import them again using the same GUI features. There are someone in Privilages tab if I remember them correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM