Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate a script of all database objects in Toad for MySQL

In the freeware version of Toad for MySQL (latest version), I can generate a script of all tables in my database in one file. However, for stored procedures and functions, Toad generates a separate script/file for each one.

Ideally, I'd like a simple step to generate a script for all objects in my database (tables, views, procedures, functions, triggers) to a single file.

Is that possible in Toad for MySQL?

like image 718
JohnB Avatar asked Nov 21 '10 20:11

JohnB


People also ask

How do I create a database script in MySQL?

Open the MySQL Workbench as an administrator (Right-click, Run as Admin). Click on File>Create Schema to create the database schema. Enter a name for the schema and click Apply. In the Apply SQL Script to Database window, click Apply to run the SQL command that creates the schema.

How do I create a SQL script in Toad?

Open the Toad and connect to the database and then click on the menu Database > Schema Browser. In the Tables tab, select the table for which you want to generate the script and do the right click. From the shortcut menu, select Create Script option.


1 Answers

I am happy to report that HeidiSQL does exactly what I need it to do. This feature alone is worth having the 3 MB .exe on your system:

alt text

As a bonus, it's lightweight and fast. It can't do everything Toad for MySQL does, but for most tasks, I will default to Heidi instead of SUPER SLOW Toad!

If someone can still answer my question about how to do this operation in Toad for MySQL, I will change my accepted answer.

(and another option I have is using mysqldump)

like image 81
JohnB Avatar answered Oct 12 '22 19:10

JohnB