{"id":6133,"date":"2015-05-21T23:19:51","date_gmt":"2015-05-21T19:19:51","guid":{"rendered":"http:\/\/www.msp360.com\/blog\/?p=6133"},"modified":"2023-12-13T13:11:38","modified_gmt":"2023-12-13T09:11:38","slug":"how-to-back-up-mysql-database","status":"publish","type":"post","link":"https:\/\/www.msp360.com\/resources\/blog\/how-to-back-up-mysql-database\/","title":{"rendered":"How to Back Up MySQL Database Using MSP360 Backup"},"content":{"rendered":"<p>The main point is that you need a script for the MySQL database backup that MSP360 Backup will run before uploading the backup to the cloud. Below there is a step-by-step guide for the MySQL backup with MSP360 Backup.<\/p>\n<p><!--more--><\/p>\n<div class=\"call-to-action\">\n<div class=\"call-to-action__left\">\n<div class=\"call-to-action__tag\">FREE WHITEPAPER<\/div>\n<div class=\"call-to-action__title\">MS SQL Server Backup and Recovery<\/div>\n<div class=\"call-to-action__text\">Check out the ultimate guide\u00a0with best practices for MSPs:<\/div>\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper hs-cta-deferred\" id=\"hs-cta-wrapper-9ed03d9c-f81b-4305-917a-03488ba39bf3\" data-portal=\"5442029\" data-id=\"9ed03d9c-f81b-4305-917a-03488ba39bf3\"><span class=\"hs-cta-node hs-cta-9ed03d9c-f81b-4305-917a-03488ba39bf3\" id=\"hs-cta-9ed03d9c-f81b-4305-917a-03488ba39bf3\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/5442029\/9ed03d9c-f81b-4305-917a-03488ba39bf3\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-9ed03d9c-f81b-4305-917a-03488ba39bf3\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/5442029\/9ed03d9c-f81b-4305-917a-03488ba39bf3.png\" alt=\"CTA\"><\/a><\/span><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div>\n<div class=\"call-to-action__right\"><img decoding=\"async\" style=\"max-width: 171px;\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2019\/07\/The-Ultimate-MSP-Guide-to-MS-SQL-Server-Backup-and-Recovery.png;\" alt=\"Exchange WP icon\" \/><\/div>\n<\/div>\n<h2>Setting Up a MySQL Database Backup<\/h2>\n<p><strong>Step 1. <\/strong>Choose temporary storage and create a folder for your backup files. For example, a C:\\MySQLBackup\\ folder.<\/p>\n<p><strong>Step 2. <\/strong>Write a script that will create a backup of your MySQL database. You can see an example below (where the database name is \u201ctest\u201d; \"root \/ p1234\" is a login account to MySQL):<\/p>\n<pre>\"C:\\Program Files\\MySQL\\MySQL Server 5.6\\bin\\mysqldump.exe\" -u root -p1234 test &gt; C:\\MySQLBackup\\testbackup.sql<\/pre>\n<p>Save this command as C:\\MySQLBackup\\MySQLBackup.bat.<\/p>\n<p><strong>Note: <\/strong>Please replace \u201c1234\u201d with your root password and \u201ctest\u201d with the name of the database that you want to back up. Also, the \u201cmysqldump.exe\u201d location can be different in your environment.<\/p>\n<p><strong>Step 3.<\/strong> Launch MSP360 Backup then click on the \"<strong>Backup Files<\/strong>\" button in the top menu.<\/p>\n<p>Specify the Backup Source. Here you need to choose the folder created in <strong>Step 1<\/strong>. If it is a network share, don't forget to specify your <a href=\"https:\/\/www.msp360.com\/resources\/blog\/backup-how-to-setup-custom-credentials-for-network-locations\/\">network credentials<\/a> in \u201c<strong>Tools | Network Credentials<\/strong>\u201d.<\/p>\n<p><strong>Step 4.<\/strong> We strongly recommended to include empty folders and hidden\/system files into your backup to fully keep the MySQL database structure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6134 size-full\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2015\/05\/MySQL_Backup_Filter.png\" alt=\"MySQL Backup Filter\" width=\"628\" height=\"492\" \/><\/p>\n<p><strong>Step 5.<\/strong> On the <strong>Pre\/Post Actions<\/strong> step, you need to specify the script created in <strong>Step 2<\/strong>. It will be executed before the backup job runs.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6135 size-full\" src=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2015\/05\/MySQL_Backup_Actions.png\" alt=\"MySQL Backup Actions\" width=\"628\" height=\"495\" srcset=\"https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2015\/05\/MySQL_Backup_Actions.png 628w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2015\/05\/MySQL_Backup_Actions-300x236.png 300w, https:\/\/www.msp360.com\/resources\/wp-content\/uploads\/2015\/05\/MySQL_Backup_Actions-624x492.png 624w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/p>\n<p><strong>Note:<\/strong> If you don't want to store the results of the \u201cmysqldump\u201d backup after you have uploaded it to the cloud, you can create the BAT file that will delete those files.<\/p>\n<p><span class=\"further-reading \">Further reading<\/span> <a href=\"https:\/\/www.msp360.com\/resources\/blog\/deleting-files-from-local-storage-after-a-successful-backup\/\">Deleting Files From Local Storage After a Successful Backup<\/a><\/p>\n<p><strong>Step 6.<\/strong> Run your backup plan, and it will execute a pre-action that creates a copy of your database and push it to the cloud afterward.<\/p>\n<h2>Summary<\/h2>\n<p>MSP360 Backup allows you to back up MySQL databases to any cloud storage. Its <strong>Pre\/Post Action<\/strong> step automatically creates a \u201cmysqldump\u201d backup of your database and then it uploads the backup to the cloud.<\/p>\n<p><strong>Note:<\/strong> You can skip the <strong>Pre\/Post Actions<\/strong> and intermediate folder steps if you manually execute the mysqldump.exe, and then specify the folder with MySQL backup data when creating a backup plan in MSP360 Backup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The main point is that you need a script for the MySQL database backup that MSP360 Backup will run before uploading the backup to the cloud. Below there is a step-by-step guide for the MySQL backup with MSP360 Backup.<\/p>\n","protected":false},"author":69,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[877,894,882],"tags":[],"class_list":["post-6133","post","type-post","status-publish","format-standard","hentry","category-blog-articles","category-msp360-backup","category-msp360-news"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts\/6133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/users\/69"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/comments?post=6133"}],"version-history":[{"count":4,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts\/6133\/revisions"}],"predecessor-version":[{"id":56902,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/posts\/6133\/revisions\/56902"}],"wp:attachment":[{"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/media?parent=6133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/categories?post=6133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msp360.com\/resources\/wp-json\/wp\/v2\/tags?post=6133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}