How to backup MySQL with MySQL workbench automatically

不问归期 提交于 2019-12-21 15:39:33

问题


Guys I'm using MySQL Workbench. Is there a way to use it to backup my database automatically?


回答1:


The correct answer is There is no backup scheduling/automating option in MySQL Workbench as of 6.2. You can do manual backup in version 6.x by clicking on DataExport under Management. See below:

MySQL WorkBench Data Export Import




回答2:


http://community.discountasp.net/showthread.php?t=11972

Making a backup in MySQL workbench is a pretty easy task, but it can be hard to find exactly where to do it the first time around. Typically when you're working in MySQL Workbench you will be using the SQL Development section. But in order to export a backup you have to move to the Server Administration section.

The first time through you will have to Create A New Server Instance. If you have already set up the connection parameters in the SQL Development section, you can just choose Take Parameters from Existing Database Connection.

MySQL Workbench will then test the connection.

In the "Remote Management Type" dialog, select Do not use remote management.

Create Instance Profile is just asking you for a name for the connection. You can enter whatever you'd like here.

When you make the connection in the Server Administration section you will see a notice that remote administration is disabled. But don't worry, you can still make a backup of your database.

Click the Data Dump tab to access the export utility.
Check the box for the database you want to back up
Choose Export to Self-Contained File and make sure the path is correct.
Hit the Start Export button.

Edit: I am using mysql administrator, which has schedule option. check this also:

http://www.davecolorado.com/index.php/scheduled-backup-with-mysql-administrator-on-windows/




回答3:


You can use Create Event in MySql workbench to create automated backups. Sample code:

CREATE EVENT IF NOT EXISTS test_event_01
ON SCHEDULE AT CURRENT_TIMESTAMP
DO
  INSERT INTO messages(message,created_at)
  VALUES('Test MySQL Event 1',NOW());

Check this link for more details: http://www.mysqltutorial.org/mysql-triggers/working-mysql-scheduled-event/



来源:https://stackoverflow.com/questions/13430876/how-to-backup-mysql-with-mysql-workbench-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!