Dump a mysql db to a file
Posted by Vince Wadhwani on Apr 23, 2008 in | gnu/linux
Ok, I'm going to file this under: stuff you don't care about but I want to keep handy just in case I forget. What is it? I'm talking about dumping a mysql db to a .sql file from the command line. Like everything else, it's really simple if you have the correct syntax. For example if your database is called blogapp, then type:
mysqldump --databases --result-file=blogsqlfile.sql blogapp -u mysqluser -p
Substituting the mysqluser user for your mysqluser (root, mysql, whatever)