Dumping tables from mysql

software development

#1

Was curious… aside from using the web interface in phpmyadmin, is there any way to selectively dump tables by a keyword - ie - matching a prefix of tblname_* using the mysqldump utility or otherwise? Although the phpmyadmin is both nifty and dandy, I’d like to find a way to automate backups if possible. Or perhaps, I’m out of my gourd completely, and there’s a simpler way to do this all? Please advise. Thankye.


#2

you could use a php script to make the dump, then fire the script via cron

[color=#0000CC]jason[/color]


#3

Is there perhaps an easier way (for sure there must be) for those that are motivationally challenged and to quote the canonical IT cliche – “let’s not reinvent the wheel folks.” If not, then - sigh - yes, yes, perhaps I will write something. Though my langue de choix is ‘perl’ because it is so friggin’ simple in form and expression. Actually maybe you got ruby and python up in there as other good, minimalist languages… Ah, but then you got all those functional programming languages and those are pretty neat-o. But I digress and I forgot what of all this was. Ah yes, I’d love to find a feature-rich simple script/app that does all this stuff so that I don’t have to. I have all these other little pet projects that I’m working on and my mind cannot deal with these constant diversions!

Yow.


#4

Someone helped me with this a while back, so I guess it’s my turn to pass it on.

Shell in and enter the following:
mysqldump -uusername -ppassword -h hostname dbname > filename

Note that there are no spaces after the -u and -p. This will back up the whole database, not just individual tables.