This post originally featured on the Echo & Co. blog.
Here’s a one-liner to dump each table in a database to it’s own .sql file. Crack open your shell of choice and follow along.
Replace the USER, PASSWORD, and DBNAME values with your own. If you’re not running this to connect to a local database, add —host=domain.tld after each password to connect to your remote server.
Users, passwords, and database names are case sensitive, I made them uppercase here to call them out. Leave a comment if you have a question or notice a problem or typo.