mysqldump create table if not exists

Issue the following command

mysqldump -p --no-data -e DATABASE_NAME | sed 's/^CREATE TABLE /CREATE TABLE IF NOT EXISTS /' > DATABASE_NAME.sql

One thought on “mysqldump create table if not exists”

  1. I love your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz reply as I’m looking to create my own blog and would like to know where u got this from. thanks

Leave a Reply

Your email address will not be published. Required fields are marked *