{"id":12460,"date":"2023-11-21T02:29:10","date_gmt":"2023-11-21T09:29:10","guid":{"rendered":"https:\/\/www.mysqltutorial.org\/?page_id=12460"},"modified":"2023-11-23T17:55:18","modified_gmt":"2023-11-24T00:55:18","slug":"mysqldump","status":"publish","type":"page","link":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/","title":{"rendered":"MySQL Backup Utility: mysqldump"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright\"><img decoding=\"async\" src=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2011\/09\/MySQL-Backup.jpg\" alt=\"MySQL Backup\" class=\"wp-image-5399\"\/><\/figure>\n<\/div>\n\n\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the <code>mysqldump<\/code> tool to make a backup of one or more databases in a MySQL Server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to the mysqldump tool<\/h2>\n\n\n\n<p>The <code>mysqldump<\/code> is a command-line utility in MySQL used for creating backups of MySQL databases. <\/p>\n\n\n\n<p>The <code>mysqldump<\/code> tool allows you to dump the structure and\/or data of one or more databases into a file, which you can use to restore the databases later.<\/p>\n\n\n\n<p>In practice, you often use the <code>mysqldump<\/code> for backup and restore operations, database migration, and transferring databases between servers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">mysqldump tool location<\/h3>\n\n\n\n<p>The <code>mysqldump<\/code> tool typically comes with the MySQL server installation by default. Its location depends on your operating system:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Linux<\/strong>: on Linux systems, including distributions like Ubuntu, CentOS, and others, you can find <code>mysqldump<\/code> in the <code>\/usr\/bin\/<\/code> directory. You can use the <code>which<\/code> command to locate it: <code>which mysqldump<\/code><\/li>\n\n\n\n<li><strong>Windows<\/strong>: on Windows, you can find the mysqldump in the directory <code>C:\\Program Files\\MySQL\\MySQL Server X.Y\\bin\\<\/code>, where <code>X.Y<\/code> is the version number of the MySQL database server.<\/li>\n\n\n\n<li><strong>macOS<\/strong>: Like Linux systems, you can find the <code>mysqldump<\/code> at <code>\/usr\/bin\/<\/code> directory on macOS.<\/li>\n<\/ul>\n\n\n\n<p>It&#8217;s a good practice to include the directory that contains <code>mysqldump<\/code> in your system&#8217;s PATH environment variable so that you can invoke the command from any location in the command prompt or terminal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic syntaxes of the mysqldump tool<\/h2>\n\n\n\n<p>There are three basic syntaxes for using the <code>mysqldump<\/code> tool:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) Dump one or more tables<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p &#91;options] db_name &#91;tbl_name ...] &gt; output_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">2) Dump one or more databases<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p &#91;options] --databases db_name ... &gt; output_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">3) Dump all databases<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p &#91;options] --all-databases &gt; output_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">The mysqldump options<\/h2>\n\n\n\n<p>The mysqldump tool provides you with two different ways to specify an option: long form and short form.<\/p>\n\n\n\n<p>For example, if you want to specify the long form for the user, you can use the <code>--user=username<\/code> option:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">--user=username<\/code><\/span><\/pre>\n\n\n<p>Alternatively, you can use the shorter and more concise option <code>-u username<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">-u username<\/code><\/span><\/pre>\n\n\n<p>Here are some common <code>mysqldump<\/code> options:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Option<\/th><th>Short Form<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td>&#8211;user<\/td><td>-u<\/td><td>username<\/td><\/tr><tr><td>&#8211;password<\/td><td>-p<\/td><td>password<\/td><\/tr><tr><td>&#8211;add-drop-database<\/td><td>N\/A<\/td><td>Add a <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-drop-database\/\">DROP DATABASE<\/a> statement before each <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-create-database\/\">CREATE DATABASE<\/a> statement<\/td><\/tr><tr><td>&#8211;add-drop-table<\/td><td>N\/A<\/td><td>Add a <a href=\"https:\/\/www.mysqltutorial.org\/mysql-drop-table\">DROP TABLE<\/a> statement before each <a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-create-table\/\">CREATE TABLE<\/a> statement.<\/td><\/tr><tr><td>&#8211;add-drop-trigger<br><\/td><td>N\/A<\/td><td>Add a <a href=\"https:\/\/www.mysqltutorial.org\/mysql-triggers\/mysql-drop-trigger\/\">DROP TRIGGER<\/a> statement before each <a href=\"https:\/\/www.mysqltutorial.org\/mysql-triggers\/mysql-create-trigger\/\">CREATE TRIGGER<\/a> statement.<\/td><\/tr><tr><td>&#8211;add-locks<br><\/td><td>N\/A<\/td><td>Enclose each table dump with LOCK TABLES and UNLOCK TABLES statements.<\/td><\/tr><tr><td>&#8211;all-databases<\/td><td>-A<\/td><td>Perform a database dump for all tables in all databases.<\/td><\/tr><tr><td>&#8211;databases<\/td><td>-B<\/td><td>Dump one or more databases by instructing mysqldump to treat all name arguments on the command line as database names.<\/td><\/tr><tr><td>&#8211;no-data<\/td><td>-d<\/td><td>Do not include any row information for the table.<\/td><\/tr><tr><td>&#8211;result-file<\/td><td>-r<\/td><td>Direct the output to a specified file. If the file already exists, the tool will overwrite it.<\/td><\/tr><tr><td>&#8211;routines<\/td><td>-R<\/td><td>Include stored routines (procedures and functions) when dumping the databases.<\/td><\/tr><tr><td>&#8211;no-create-db<\/td><td>-n<\/td><td>Suppress the <code>CREATE DATABASE<\/code> statements that would otherwise be included in the output when the <code>--databases<\/code> or <code>--all-databases<\/code> option is given.<\/td><\/tr><tr><td>&#8211;no-create-info<\/td><td>-t<\/td><td>Do not include <code>CREATE TABLE<\/code>\u00a0statements for each dumped table.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The mysqldump tool examples<\/h2>\n\n\n\n<p>Let&#8217;s explore some examples of using the <code>mysqldump<\/code> tool to create backups.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1) Creating a backup of a single database<\/h3>\n\n\n\n<p>The following command creates a backup of a single database:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">mysqldump -u username -p -B db_name &gt; path_to_backup_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>mysqldump<\/code>: This is the command-line utility for MySQL database backups.<\/li>\n\n\n\n<li><code>-u username<\/code>: This option specifies the MySQL user to use for the connection. Replace <code>username<\/code> with the actual username you want to use.<\/li>\n\n\n\n<li><code>-p<\/code>: This option prompts you for the password associated with the MySQL user specified by the <code>-u<\/code> option. After entering the command, you will be prompted to enter the password interactively.<\/li>\n\n\n\n<li><code>-B<\/code>: This option tells <code>mysqldump<\/code> to treat the next argument as a database name, rather than a list of tables. In your command, <code>db_name<\/code> is the database name you want to back up.<\/li>\n\n\n\n<li><code>db_name<\/code>: Replace this with the name of the MySQL database you want to back up.<\/li>\n\n\n\n<li><code>&gt; path_to_backup_file<\/code>: This part of the command redirects the output of <code>mysqldump<\/code> to a file specified by <code>path_to_backup_file<\/code>. This is where the backup data will be stored.<\/li>\n<\/ul>\n\n\n\n<p>For example, the following command creates a backup of the database <code>classicmodels<\/code> to the file <code>D:\\backup\\classicmodels.sql<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p -B classicmodels &gt; D:\\backup\\classicmodels.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>It&#8217;ll prompt you to enter a password for the root account. After inputting a valid password for the root account, the tool will dump the <code>classicmodels<\/code> database into the file <code>D:\\backup\\classicmodels.sql<\/code><\/p>\n\n\n\n<p>If you want to put the password in the command, you can use the <code>--password<\/code> long-form option:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root --password=Abcd1234 -B classicmodels &gt; D:\\backup\\classicmodels.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>It&#8217;ll issue a warning:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump: &#91;Warning] Using a password on the command line interface can be insecure.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">2) Creating a backup of multiple databases<\/h3>\n\n\n\n<p>To make a backup of multiple databases, you specify a list of the database names after the <code>--database<\/code> option:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u username -p -B &lt;dbname1&gt;&#91;,&lt;dbname2&gt;, ...] &gt; path_to_backup_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>mysqldump<\/code>: This is the command-line utility for MySQL database backup.<\/li>\n\n\n\n<li><code>-u username<\/code>: This option specifies the MySQL user to be used for the operation. You would replace &#8220;username&#8221; with the actual MySQL username.<\/li>\n\n\n\n<li><code>-p<\/code>: This option prompts for the MySQL user&#8217;s password. After entering the command, you will be prompted to provide the password.<\/li>\n\n\n\n<li><code>-B<\/code>: This option is used to indicate that one or more databases will follow. It&#8217;s followed by the list of databases you want to include in the backup.<\/li>\n\n\n\n<li><code>&lt;dbname1&gt;[,&lt;dbname2&gt;, ...]<\/code>: This part specifies the name of the database or databases you want to back up. You can list multiple databases separated by commas.<\/li>\n\n\n\n<li><code>&gt; path_to_backup_file<\/code>: This part of the command redirects the output of the mysqldump operation to a file specified by &#8220;path_to_backup_file&#8221;.<\/li>\n<\/ul>\n\n\n\n<p>For example, the following command makes a backup of the <code>classicmodels<\/code> and <code>world<\/code> databases:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p --databases classicmodels world &gt; D:\\backup\\databases.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">3) Creating a backup of all databases<\/h3>\n\n\n\n<p>To make a backup of all databases in a MySQL Server, you use the -A option:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u username -p -A &gt; path_to_backup_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following statement makes a backup of all databases in the current MySQL server:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p -A &gt; D:\\backup\\all_databases.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">4) Creating a backup of specific tables in a database<\/h3>\n\n\n\n<p>To make a backup of one or more tables from a database, you use the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u username -p db_name tbl_name1, tbl_name2,... &gt; path_to_backup_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example, to make a backup of the <code>employees<\/code> table from the <code>classicmodels<\/code> database, you use the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p classicmodels employees &gt; d:\\backup\\employees.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">5) Creating a backup of the database structure only<\/h3>\n\n\n\n<p>To make a backup of the database structure only, you use the <code>-d<\/code> option:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u username -p -d db_name &gt; path_to_backup_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The statement will generate a dump file that contains the SQL statement necessary to re-create the database structure. The dump file does not contain <code>INSERT<\/code> statements.<\/p>\n\n\n\n<p>For example, the following statement makes a backup of the database structure of the database <code>classicmodels<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p -d classicmodels &gt; d:\\backup\\classicmodels.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">6) Creating a backup of data only<\/h3>\n\n\n\n<p>To make a backup of the database data only, you use the <code>-t<\/code> option:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-16\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u username -p -t db_name &gt; path_to_backup_file<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-16\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The statement will generate a dump file that contains the SQL statements necessary to lock tables and insert data into the tables. It has no <code>CREATE TABLE<\/code> statements.<\/p>\n\n\n\n<p>The following command makes a backup of data from the database <code>classicmodels<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-17\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mysqldump -u root -p -t classicmodels &gt; d:\\backup\\classicmodels.sql<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-17\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>mysqldump<\/code> utility program to create backups of databases in MySQL Server.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful? <\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"12460\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/\"\n\t\t\t\tdata-post-title=\"MySQL Backup Utility: mysqldump\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"12460\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/\"\n\t\t\t\tdata-post-title=\"MySQL Backup Utility: mysqldump\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you will learn how to use the mysqldump tool to make a backup of one or more databases in a MySQL Server. Introduction to the mysqldump tool The mysqldump is a command-line utility in MySQL used for creating backups of MySQL databases. The mysqldump tool allows you to dump the structure [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":441,"menu_order":45,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-12460","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MySQL Backup Utility: mysqldump<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to use the mysqldump tool to create a backup of one or more databases in a MySQL Server.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MySQL Backup Utility: mysqldump\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to use the mysqldump tool to create a backup of one or more databases in a MySQL Server.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/\" \/>\n<meta property=\"og:site_name\" content=\"MySQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-24T00:55:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2011\/09\/MySQL-Backup.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/\",\"name\":\"MySQL Backup Utility: mysqldump\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mysqltutorial.org\\\/wp-content\\\/uploads\\\/2011\\\/09\\\/MySQL-Backup.jpg\",\"datePublished\":\"2023-11-21T09:29:10+00:00\",\"dateModified\":\"2023-11-24T00:55:18+00:00\",\"description\":\"In this tutorial, you will learn how to use the mysqldump tool to create a backup of one or more databases in a MySQL Server.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/mysqldump\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MySQL Administration\",\"item\":\"https:\\\/\\\/www.mysqltutorial.org\\\/mysql-administration\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MySQL Backup Utility: mysqldump\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mysqltutorial.org\\\/#website\",\"url\":\"https:\\\/\\\/www.mysqltutorial.org\\\/\",\"name\":\"MySQL Tutorial\",\"description\":\"A comprehensive MySQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mysqltutorial.org\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MySQL Backup Utility: mysqldump","description":"In this tutorial, you will learn how to use the mysqldump tool to create a backup of one or more databases in a MySQL Server.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/","og_locale":"en_US","og_type":"article","og_title":"MySQL Backup Utility: mysqldump","og_description":"In this tutorial, you will learn how to use the mysqldump tool to create a backup of one or more databases in a MySQL Server.","og_url":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/","og_site_name":"MySQL Tutorial","article_modified_time":"2023-11-24T00:55:18+00:00","og_image":[{"url":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2011\/09\/MySQL-Backup.jpg","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/","url":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/","name":"MySQL Backup Utility: mysqldump","isPartOf":{"@id":"https:\/\/www.mysqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/#primaryimage"},"image":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mysqltutorial.org\/wp-content\/uploads\/2011\/09\/MySQL-Backup.jpg","datePublished":"2023-11-21T09:29:10+00:00","dateModified":"2023-11-24T00:55:18+00:00","description":"In this tutorial, you will learn how to use the mysqldump tool to create a backup of one or more databases in a MySQL Server.","breadcrumb":{"@id":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.mysqltutorial.org\/mysql-administration\/mysqldump\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mysqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"MySQL Administration","item":"https:\/\/www.mysqltutorial.org\/mysql-administration\/"},{"@type":"ListItem","position":3,"name":"MySQL Backup Utility: mysqldump"}]},{"@type":"WebSite","@id":"https:\/\/www.mysqltutorial.org\/#website","url":"https:\/\/www.mysqltutorial.org\/","name":"MySQL Tutorial","description":"A comprehensive MySQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mysqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/12460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/comments?post=12460"}],"version-history":[{"count":4,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/12460\/revisions"}],"predecessor-version":[{"id":12485,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/12460\/revisions\/12485"}],"up":[{"embeddable":true,"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/pages\/441"}],"wp:attachment":[{"href":"https:\/\/www.mysqltutorial.org\/wp-json\/wp\/v2\/media?parent=12460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}