如何完全转储数据库?

问题描述:

我想完全转储数据库及其存储过程。



我尝试过:



我试图搜索这个并发现如何使用MySQL工作台进行此操作,但我想使用脚本来实现这一点。

我还发现这个代码片段可以执行来自MySQL命令行:

I want to fully dump a database with its stored procedures.

What I have tried:

I have tried to search about this and found how to do this using MySQL workbench but i want to make it using a script.
I also found this snippet to execute from MySQL command line:

shell> mysqldump [arguments] > file_name



是否有人知道如何使用工作台中的脚本执行此操作?


Does any one know how to do this using a script in workbench?

您好,

你可以使用这个命令它将转储包括数据库存储过程在内的所有东西:

Hi,
you can use this command it will dump everything including stored procedure for a database only:
mysqldump -u USER -p  --events --routines --triggers --databases XXX





或所有数据库:



or for all database:

mysqldump -u USER -p  --events --routines --triggers --all-databases