If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to script out all database objects?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-23-09, 10:04
sql_er sql_er is offline
Registered User
 
Join Date: Jan 2007
Posts: 48
How to script out all database objects?

Hello,

I am trying to script out the following database objects from my database so that I can execute the .SQL script on another database to make it same (except for the data):
- tables
- triggers
- stored procedures
- functions
- views

I used the following command:

mysqldump --no-data --routines -u username -ppassword <database name> | sed 's/\(.*ENGINE.*AUTO_INCREMENT=\).*/\10;/g' > dump.sql

When I look at the dump.sql, I see that except for the tables, all the other objects are commented out. Is this the default behavior? How to make sure the items in the script are not commented out so that the script can be executed as is on another database, creating all the necessary objects?

Thank you!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On