Hello friends,
Welcome back again. In this story, I’m going to explain how to export mysql database by tables.
When we use `mysqldump` command for exporting entire database, it actually exports db in a single file. For some reason, I need to export all tables from a database but in separate/split files but it was not possible by using `mysqldump`. So I googled for it and I found solution, which I’m sharing here with you.
Actually this is a small bash shell script, through which I’ve exported database into multiple files by table. This bash shell script runs on linux. For windows/mac, I’ll share solution as I get.
Linux Code:
Execute above code in terminal, it will ask every time for password, if you want to avoid of asking password, then add your password after -p parameter in `mysqldump` command.
Enjoy coding 😃
Thanks.
Welcome back again. In this story, I’m going to explain how to export mysql database by tables.
When we use `mysqldump` command for exporting entire database, it actually exports db in a single file. For some reason, I need to export all tables from a database but in separate/split files but it was not possible by using `mysqldump`. So I googled for it and I found solution, which I’m sharing here with you.
Actually this is a small bash shell script, through which I’ve exported database into multiple files by table. This bash shell script runs on linux. For windows/mac, I’ll share solution as I get.
Linux Code:
Execute above code in terminal, it will ask every time for password, if you want to avoid of asking password, then add your password after -p parameter in `mysqldump` command.
Enjoy coding 😃
Thanks.
Comments
Post a Comment
Want to share something? Add here...