MySQL/MariaDB backup procedures, function, and triggers

Perhaps many people are asking about how to backup procedures, function, or triggers in MySQL/MariaDB. And now I know how to backup that using mysqldump command.
Example I have database with name exampledb, and if we perform regular backups, then the command is:

--if we use Linux
user@username~$ mysqldump -u root -p exampledb > /home/username/Downloads/exampledb.sql

--if we use windows
C:\Users\user>mysqldump -u root -p exampledb > C:\Users\username\Downloads

With the above command, we can get backup (all table) from the exampledb database. But if we’ve the function or procedure in the database, the function or procedure not included. And to include that, we must add command options “–routines” like this:

--if we use Linux
user@user~$ mysqldump --routines  -u root -p exampledb > /home/username/Downloads/exampledb.sql

--if we use windows
C:\Users\username>mysqldump --routines -u root -p exampledb > C:\Users\username\Downloads

But if we want only backup the procedure, functions and triggers, we must change the command like this:

--if we use Linux
user@user~$ mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt -u root -p exampledb > /home/username/Downloads/exampledb.sql

--if we use windows
C:\Users\username>mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt -u root -p exampledb > C:\Users\username\Downloads

And finish…. Easy right?πŸ˜€


  1. I’m not sure why but this blog is loading incredibly slow for me.
    Is anyone else having this issue or is it a problem on my end?
    I’ll check back later on and see if the problem still exists.

  2. Your style is really unique compared to other folks I’ve read stuff
    from. I appreciate you for posting when you’ve got the opportunity,
    Guess I’ll just book mark this blog.

  3. I’ll immediately grab your rss as I can not find your e-mail subscription link
    or e-newsletter service. Do you have any? Kindly let me understand in order that I may just subscribe.

  4. Hi, I do think this is a great blog. I stumbledupon itπŸ˜‰ I will revisit once again since I book-marked it.

    Money and freedom is the best way to change, may you be rich and continue to guide
    other people.

  5. You are so cool! I don’t believe I’ve truly read through something like this before.
    So good to discover somebody with original thoughts on this
    topic. Seriously.. many thanks for starting this up.
    This web site is one thing that is needed on the
    internet, someone with a bit of originality!

  6. It’s the best time to make a few plans for the future and
    it’s time to be happy. I’ve learn this submit and if I could I want to suggest
    you few fascinating things or advice. Perhaps you could write next
    articles regarding this article. I desire
    to read even more things about it!

  7. Hello there! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest writing a blog post or vice-versa?
    My site addresses a lot of the same topics as yours and I think we could
    greatly benefit from each other. If you might be interested feel free to send me an email.
    I look forward to hearing from you! Terrific blog by the way!

  8. Thanks for one’s marvelous posting! I genuinely enjoyed
    reading it, you might be a great author. I will ensure that I bookmark your blog and definitely will come back someday.
    I want to encourage continue your great job, have a nice weekend!

  9. Wonderful blog! Do you have any recommendations for aspiring writers?
    I’m hoping to start my own blog soon but I’m a little
    lost on everything. Would you propose starting with a free platform like WordPress or go for
    a paid option? There are so many options out there that I’m
    completely overwhelmed .. Any suggestions? Kudos!

  10. I simply desired to thank you very much once again. I do not know what I might have gone through in the absence of the type of methods shared by you over such area of interest. It became a terrifying crisis in my view, nevertheless witnessing this specialized tactic you processed it forced me to cry with contentment. Now i’m happier for your assistance and even sincerely hope you know what a great job you have been undertaking educating the rest thru your site. I am sure you have never met all of us.

    1. Really sorry for that, yes I know my English spelling very very not good, because I not learn english in classroom but learning using google translate, I not have money to buy a book. My blog not have a donors, I do not get money from this website..😦

  11. A motivating discussion is worth comment. I believe that you
    need to publish more on this subject matter, it may not be a
    taboo subject but generally people do not talk about these
    topics. To the next! All the best!!

  12. Thanks just for sharing.It had been certainly delightful reading about your views on this kind of area of interest.I had been looking for such a article for a long time,and gratefully i found your site.I really hope you will keep assisting people in the same way in future also.

  13. Thanks for sharing.It was quite superb looking at regarding your whole opinion of this particular theme.I was searching for such a article fro some time,and thankfully i found your site.I am hoping you certainly will continue to keep supporting people in the same way in future also.

  14. I’m truly enjoying the design and layout of your site.
    It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire
    out a designer to create your theme? Great work!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s