{"id":14446,"date":"2015-08-04T09:53:29","date_gmt":"2015-08-04T09:53:29","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=3079"},"modified":"2015-08-04T09:53:29","modified_gmt":"2015-08-04T09:53:29","slug":"how-to-back-up-your-mysql-databases","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2015\/08\/04\/how-to-back-up-your-mysql-databases\/","title":{"rendered":"How To Back Up Your MySQL Databases"},"content":{"rendered":"<p>MySQL is an open source relational database management system (DBMS) which is frequently deployed in a wide assortment of contexts. Most frequently it is deployed as part of the\u00a0LAMP Stack. The database system is also easy to use and highly portable and is, in the context of many applications, extremely efficient. As MySQL is often a centralized data store for large amounts of mission critical data, making regular backups of your MySQL database is one of the most important disaster recovery tasks a system administrator can perform. This guide addresses a number of distinct methods for creating back ups of your database as well as restoring databases from backups.<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"backup-methodology\">Backup Methodology<\/h2>\n<p>Most backups of MySQL databases in this guide are performed using the\u00a0<code>mysqldump<\/code>\u00a0tool, which is distributed with the default MySQL server installation. We recommend that you use\u00a0<code>mysqldump<\/code>whenever possible because it is often the easiest and most efficient way to take database backups. Other methods detailed in this guide are provided for situations when you do not have access to the\u00a0<code>mysqldump<\/code>\u00a0tool, as in a recovery environment like\u00a0Finnix\u00a0or in situations where the local instance of the MySQL server will not start.<\/p>\n<p>Nevertheless, this guide provides a mere overview of the\u00a0<code>mysqldump<\/code>\u00a0tool, as there are many options for and uses of\u00a0<code>mysqldump<\/code>\u00a0that fall beyond the scope of this document. We encourage you to become familiar with all of the procedures covered in this document, and to continue your exploration of\u00a0<code>mysqldump<\/code>\u00a0beyond the cases described here. Be sure to note the following:<\/p>\n<ul>\n<li>The\u00a0<code>*.sql<\/code>\u00a0files created with\u00a0<code>mysqldump<\/code>\u00a0can be restored at any time. You can even edit the database\u00a0<code>.sql<\/code>\u00a0files manually (with great care!) using your favorite text editor.<\/li>\n<li>If your databases only make use of the MyISAM storage engine, you can substitute the\u00a0<code>mysqldump<\/code>\u00a0command with the faster\u00a0<code>mysqlhotcopy<\/code>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2 id=\"creating-backups-of-the-entire-database-management-system-dbms\">Creating Backups of the Entire Database Management System (DBMS)<\/h2>\n<p>It is often necessary to take a back up (or \u201cdump\u201d) of an entire database management system along with all databases and tables, including the system databases which hold the users, permissions and passwords.<\/p>\n<h3 id=\"option-1-create-backups-of-an-entire-database-management-system-using-the-mysqldump-utility\">Option 1: Create Backups of an Entire Database Management System Using the mysqldump Utility<\/h3>\n<p>The most straight forward method for creating a single coherent backup of the entire MySQL database management system uses the\u00a0<code>mysqldump<\/code>\u00a0utility from the command line. The syntax for creating a database dump with a current timestamp is as follows:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysqldump --all-databases &gt; dump-$( date '+%Y-%m-%d_%H-%M-%S' ).sql -u root -p\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>This command will prompt you for a password before beginning the database backup in the current directory. This process can take anywhere from a few seconds to a few hours depending on the size of your databases.<\/p>\n<p>Automate this process by adding a line to\u00a0<code>crontab<\/code>:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>0 1 * * * \/usr\/bin\/mysqldump --all-databases &gt; dump-$( date '+%Y-%m-%d_%H-%M-%S' ).sql -u root -pPASSWORD\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>For the example above, use\u00a0<code>which mysqldump<\/code>\u00a0to confirm the correct path to the command, and replace\u00a0<code>root<\/code>\u00a0with the mysql user you would like to run backups as, and\u00a0<code>PASSWORD<\/code>\u00a0with the correct password for that user.<\/p>\n<blockquote class=\"note\"><p>In the crontab example, ensure that there is no space between the -P flag, and your password entry.<\/p><\/blockquote>\n<h3 id=\"option-2-create-backups-of-an-entire-dbms-using-copies-of-the-mysql-data-directory\">Option 2: Create Backups of an Entire DBMS Using Copies of the MySQL Data Directory<\/h3>\n<p>While the\u00a0<code>mysqldump<\/code>\u00a0tool is the preferred backup method, there are a couple of cases that require a different approach.\u00a0<code>mysqldump<\/code>\u00a0only works when the database server is accessible and running. If the database cannot be started or the host system is inaccessible, we can copy MySQL\u2019s database directly. This method is often necessary in situations where you only have access to a recovery environment like\u00a0Finnix\u00a0with your system\u2019s disks mounted in that file system. If you\u2019re attempting this method on your system itself, ensure that the database is\u00a0<strong>not<\/strong>\u00a0running. Issue a command that resembles the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>\/etc\/init.d\/mysqld stop\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>On most distribution\u2019s version of MySQL, the data directory is located in the\u00a0<code>\/var\/lib\/mysql\/<\/code>directory. If this directory doesn\u2019t exist examine the\u00a0<code>\/etc\/mysql\/my.cnf<\/code>\u00a0file for a path to the data directory. Alternatively, you can search your file system for the data directory by issuing the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>find \/ -name mysql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Once you have located your MySQL data directory you can copy it to a backup location. The following example assumes that the MySQL data directory is located at\u00a0<code>\/var\/lib\/mysql\/<\/code>:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>cp -R \/var\/lib\/mysql\/* \/opt\/database\/backup-1266871069\/\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In this case, we have recursively copied the contents of the data directory (e.g.\u00a0<code>\/var\/lib\/mysql\/<\/code>) to a directory within the\u00a0<code>\/opt\/<\/code>\u00a0hierarchy (e.g.\u00a0<code>\/opt\/database\/backup-1266871069\/<\/code>). This directory must exist before initiating the copy operation. Consider the following sequence of operations:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2\n3<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>\/etc\/init.d\/mysql stop\nmkdir -p \/opt\/database\/backup-1266872202\/\ncp -R \/var\/lib\/mysql\/* \/opt\/database\/backup-1266872202\/\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>These commands begin by stopping the MySQL server daemon, then creating a directory named\u00a0<code>\/opt\/database\/backup-1266872202\/<\/code>, and performing a recursive copy of the data directory. Note that we\u2019ve chosen to use the\u00a0<code>backup-[time_t]<\/code>\u00a0naming convention for our examples. Substitute the paths\u2019 above for your preferred organization and naming scheme. The\u00a0<code>cp<\/code>\u00a0command does not produce output and can take some time to complete depending on the size of your database. Do not be alarmed if it takes a while to complete. When the copy operation is finished, you may want to archive the data directory into a \u201ctar\u201d archive to make it easier to manage and move between machines. Issue the following commands to create the archive:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>cd \/opt\/database\/backup-1266872202\ntar -czfv * &gt; \/opt\/mysqlBackup-1266872202.tar.gz \n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Once the tarball is created, you can easily\u00a0transfer the file\u00a0in the manner that is most convenient for you. Don\u2019t forget to restart the MySQL server daemon again if needed:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>\/etc\/init.d\/mysql start\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 id=\"creating-backups-of-a-single-database\">Creating Backups of a Single Database<\/h2>\n<p>In many cases, creating a back up of the entire database server isn\u2019t required. In some cases such as upgrading a web application, the installer may recommend making a backup of the database in case the upgrade adversely affects the database. Similarly, if you want to create a \u201cdump\u201d of a specific database to move that database to a different server, you might consider the following method.<\/p>\n<p>When possible, use the\u00a0<code>mysqldump<\/code>\u00a0tool to export a \u201cdump\u201d of a single database. This command will resemble the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysqldump -u squire -ps3cr1t -h localhost danceLeaders &gt; 1266861650-danceLeaders.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The above example is like the example in the previous section, except rather than using the\u00a0<code>--all-databases<\/code>\u00a0option, this example specifies a particular database name. In this case we create a back up of the\u00a0<code>danceLeaders<\/code>\u00a0database. The form of this command, in a more plain notation is as follows:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysqldump -u [username] -p[password] -h [host] [databaseName] &gt; [backup-name].sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>For an additional example, we will backup the database named\u00a0<code>customer<\/code>\u00a0using the root database account by issuing the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysqldump -u root -p -h localhost customer &gt; customerBackup.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for a password before\u00a0<code>mysqldump<\/code>\u00a0begins it\u2019s backup process. As always the backup file, in this case\u00a0<code>customerBackup.sql<\/code>, is created in the directory where you issue this command. The\u00a0<code>mysqldump<\/code>\u00a0command can complete in a few seconds or a few hours depending on the size of the database and the load on the host when running the backup.<\/p>\n<h2 id=\"creating-backups-of-a-single-table\">Creating Backups of a Single Table<\/h2>\n<h3 id=\"option-1-create-backups-of-a-single-table-using-the-mysqldump-utility\">Option 1: Create Backups of a Single Table Using the mysqldump Utility<\/h3>\n<p>This operation, like previous uses of the\u00a0<code>mysqldump<\/code>\u00a0utility in this document, allows you to create a backup of a single database table. Continuing our earlier examples the following example allows you to back up the table\u00a0<code>squireRecords<\/code>\u00a0in the\u00a0<code>danceLeaders<\/code>\u00a0database.<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> mysqldump -u squire -ps3cr1t -h localhost danceLeaders squireRecords \\&gt; 1266861650-danceLeaders-squireRecords.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The above example is like the example in the previous section, except that we\u2019ve added a table name specification to the command to specify the name of the table that we want to back up. The form of this command in a more plain notation is as follows:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysqldump -u [username] -p[password] -h [host] [databaseName] [tableName] &gt; [backup-name].sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>For an additional example, we will backup the table named \u201corder\u201d from the database named\u00a0<code>customer<\/code>\u00a0using the root database account by issuing the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysqldump -u root -p -h localhost customer order &gt; customerBackup-order.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for a password before\u00a0<code>mysqldump<\/code>\u00a0begins its backup process. As always, the backup file (in this case\u00a0<code>customerBackup.sql<\/code>) is created in the directory where you issue this command. The\u00a0<code>mysqldump<\/code>\u00a0command can complete in a few seconds or a few hours depending on the size of the database and the load on the host when running the backup.<\/p>\n<h3 id=\"option-2-create-backups-of-a-single-table-using-the-mysql-client-and-an-outfile-statement\">Option 2: Create Backups of a Single Table Using the MySQL Client and an OUTFILE Statement<\/h3>\n<p>The MySQL client itself has some backup capability. It is useful when you are already logged in and you do not want to exit the current session. If you are using a live system and cannot afford down time, you should consider temporarily locking the table you\u2019re backing up.<\/p>\n<p>Do be aware that when backing up a single table using the MySQL client, that table\u2019s structure is not maintained in the backup. Only the data itself is saved when using this method.<\/p>\n<ol>\n<li>Before we begin, we recommend performing a\u00a0<code>LOCK TABLES<\/code>\u00a0on the tables you intend to backup up, followed by\u00a0<code>FLUSH TABLES<\/code>\u00a0to ensure that the database is in a consistent space during the backup operation. You only need a read lock. This allows other clients to continue to query the tables while you are making a copy of the files in the MySQL data directory. For a \u201cread\u201d lock, the syntax of\u00a0<code>LOCK TABLES<\/code>\u00a0looks like the following:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>LOCK TABLES tableName READ;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>To perform a\u00a0<code>LOCK TABLES<\/code>\u00a0on the\u00a0<code>order<\/code>\u00a0table of the\u00a0<code>customer<\/code>\u00a0database, issue the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p -h localhost\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will then be prompted for the root password. Once you have entered the database credentials, you will arrive at the mysql client prompt. Issue the following command to lock the\u00a0<code>order<\/code>\u00a0table in the\u00a0<code>customer<\/code>\u00a0database (the trailing\u00a0<code>;<\/code>\u00a0is required for MySQL commands):<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2\n3<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>USE customer;\nLOCK TABLES order READ;\nFLUSH TABLES;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>We can now begin the backup operation. To create a backup of a single table using the MySQL client, you will need to be logged in to your MySQL DBMS. If you are not currently logged in you may log in with the following command:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> mysql -u root -p -h localhost\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for a password. Once you have entered the correct password and are at the MySQL client prompt, you can use a\u00a0<code>SELECT * INTO OUTFILE<\/code>\u00a0statement. The syntax of this statement looks like the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> SELECT * INTO OUTFILE 'file_name' FROM tbl_name;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In this example, we will create a backup of the data from the\u00a0<code>order<\/code>\u00a0table of the\u00a0<code>customer<\/code>database. Issue the following command to begin the backup procedure (the trailing\u00a0<code>;<\/code>\u00a0is required for MySQL commands):<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2\n3\n4\n5<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> USE customer;\n LOCK TABLES order READ;\n FLUSH TABLES;\n SELECT * INTO OUTFILE 'customerOrderBackup.sql' FROM order;\n UNLOCK TABLES;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The\u00a0<code>customerOrderBackup.sql<\/code>\u00a0file will be created in the appropriate data sub-directory within MySQLs data directory. The MySQL data directory is commonly\u00a0<code>\/var\/lib\/mysql\/<\/code>. In this example, the\u00a0<code>OUTFILE<\/code>\u00a0will be\u00a0<code>\/var\/lib\/mysql\/customer\/customerOrderBackup.sql<\/code>. The location of this directory and file can, however, vary between Linux distributions. If you can not find your backup file, you can search for it with the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>find \/ -name customerOrderBackup.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>Once you have completed the backup operation, you will want to unlock the tables using the following command in the MySQL client. This will return your database to its normal operation. Log in to the MySQL client with the first command if you are not presently logged in and then issue the second command:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2\n3<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -uroot -p -h localhost\n\nUNLOCK TABLES;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<\/ol>\n<p>You can continue using your database as normal from this point.<\/p>\n<h2 id=\"considerations-for-an-effective-backup-strategy\">Considerations for an Effective Backup Strategy<\/h2>\n<p>Creating backups of your MySQL database should be a regular and scheduled task. You might like to consider scheduling periodic backups using\u00a0<code>cron<\/code>,\u00a0<code>mysqldump<\/code>\u00a0and\/or\u00a0<code>mail<\/code>. Consider our documentation for more information regarding\u00a0cron. Implementing an automated backup solution may help minimize down time in a disaster recovery situation.<\/p>\n<p>You do not need to log in as root when backing up databases. A MySQL user with read (e.g.\u00a0<code>SELECT<\/code>) permission is able to use both the\u00a0<code>mysqldump<\/code>\u00a0and\u00a0<code>mysql<\/code>\u00a0(e.g. the MySQL client) tools to take backups, as described below. As a matter of common practice, we recommend that you not use the MySQL\u00a0<code>root<\/code>\u00a0user whenever possible to minimize security risks.<\/p>\n<p>You may want to consider incremental backups as part of a long-term database backup plan. While this process is not covered here, we recommend that you consider the\u00a0MySQL Database Backup Methods\u00a0resource for more information.<\/p>\n<h2 id=\"restoring-an-entire-dbms-from-backup\">Restoring an Entire DBMS From Backup<\/h2>\n<p>A backup that cannot be restored is of minimal value. We recommend testing your backups regularly to ensure that they can be restored in the event that you may need to restore from backups. When using restoring backups of your MySQL database, the method you use depends on the method you used to create the backup in question.<\/p>\n<h3 id=\"option-1-restoring-an-entire-dbms-using-the-mysql-client-and-backups-created-by-mysqldump\">Option 1: Restoring an Entire DBMS Using the MySQL Client and Backups Created by mysqldump<\/h3>\n<p>Before beginning the restoration process, this section assumes your system is running a newly installed version of MySQL without any existing databases or tables. If you already have databases and tables in your MySQL DBMS, please make a backup before proceeding as this process will\u00a0<strong>overwrite current MySQL data.<\/strong><\/p>\n<p>You can easily restore your entire DBMS using the\u00a0<code>mysql<\/code>\u00a0command. The syntax for this will resemble the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u [username] -p [password] &lt; backupFile.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In this case we\u2019re simply restoring the entire DBMS. The command will look like the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p &lt; 1266861650-backup-all.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for the root MySQL user\u2019s password. Once the correct credentials are supplied, the restoration process will begin. Since this process restores an entire DBMS, it can take anywhere from a few seconds to many hours.<\/p>\n<h3 id=\"option-2-restoring-an-entire-dbms-using-mysql-data-files-copied-directly-from-mysqls-data-directory\">Option 2: Restoring an Entire DBMS Using MySQL Data Files Copied Directly from MySQL\u2019s Data Directory<\/h3>\n<p>Before beginning the restoration process, this section assumes your system is running a newly installed version of MySQL without any existing databases or tables. If you already have databases and tables in your MySQL DBMS, please make a backup before proceeding as this process will\u00a0<strong>overwrite current MySQL data.<\/strong><\/p>\n<ol>\n<li>If you have a complete backup of your MySQL data directory (commonly\u00a0<code>\/var\/lib\/mysql<\/code>), you can restore it from the command line. To ensure a successful restore, you must first stop the MySQL server daemon and delete the current data in the MySQL data directory.\n<p>\/etc\/init.d\/mysql stop rm -R \/var\/lib\/mysql\/*<\/li>\n<li>In the following example, the MySQL data directory backup is located in the\u00a0<code>\/opt\/database\/backup-1266872202<\/code>\u00a0directory. If you made a tarball of the data directory when you backed up your DBMS data directory, you will need to extract the files from the tarball before copying with the following commands:\n<p>cp mysqlBackup-1266872202.tar.gz \/var\/lib\/mysql\/ cd \/var\/lib\/mysql tar xzvf mysqlBackup-1266872202.tar.gz<\/li>\n<li>Before we can restart the MySQL database process, we must ensure that the permissions are set correctly on the\u00a0<code>\/var\/lib\/mysql\/<\/code>\u00a0directory. For this example, we assume the MySQL server daemon runs as the user\u00a0<code>mysql<\/code>\u00a0with the group\u00a0<code>mysql<\/code>. To change the permissions on the data directory issue the following command:\n<p>chown -R mysql:mysql \/var\/lib\/mysql<\/li>\n<li>Alter the\u00a0<code>mysql:mysql<\/code>\u00a0portion of this command if your MySQL instance runs with different user and group permissions. The form of this argument is\u00a0<code>[user]:[group]<\/code>. Finally we can start the MySQL server daemon with the following command:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> \/etc\/init.d\/mysql start\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>If you receive an error similar to the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> \/usr\/bin\/mysqladmin: connect to server at 'localhost' failed\n     error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You\u2019ll need to find the old\u00a0<code>debian-sys-maint<\/code>\u00a0user\u2019s password in the\u00a0<code>\/etc\/mysql\/debian.cnf<\/code>\u00a0and then change the new\u00a0<code>debian-sys-maint<\/code>\u00a0user\u2019s password to it. You can view the old password using\u00a0<code>cat<\/code>:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> cat \/etc\/mysql\/debian.cnf | grep password\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Copy (or remember) the password. Then you\u2019ll need to change the new\u00a0<code>debian-sys-maint<\/code>\u00a0user\u2019s password. You can do this by logging in as the MySQL root user and issuing the following command (where &lt;password&gt; is the password of the old\u00a0<code>debian-sys-maint<\/code>\u00a0user):<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '&lt;password&gt;' WITH GRANT OPTION;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>You\u2019ll then need to restart MySQL with the following command:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>\/etc\/init.d\/mysql restart\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<\/ol>\n<p>After MySQL server has successfully started, you will want to test your MySQL DBMS and ensure that all databases and tables restored properly. We also recommend that you audit your logs for potential errors. In some cases MySQL can start successfully despite database errors.<\/p>\n<h2 id=\"restoring-a-single-database-from-backup\">Restoring a Single Database from Backup<\/h2>\n<p>In cases where you have only created a backup for one database, or only need to restore a single database, the restoration process is somewhat different.<\/p>\n<p>Before beginning the restoration process, this section assumes your system is running a newly installed version of MySQL without any existing databases or tables. If you already have databases and tables in your MySQL DBMS, please make a backup before proceeding as this process will\u00a0<strong>overwrite current MySQL data.<\/strong><\/p>\n<ol>\n<li>To restore a single database using the\u00a0<code>mysql<\/code>\u00a0command, first prepare the destination database. Log in to your (new) MySQL database server using the MySQL client:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> mysql -u root -p -h localhost\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>You will be prompted for the root MySQL user\u2019s password. After you have provided the correct credentials, you must create the destination database. In this case, the\u00a0<code>customer<\/code>\u00a0database will be restored:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> CREATE DATABASE customer;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>As with all MySQL statements, do not omit the final semi-colon (e.g.\u00a0<code>;<\/code>) at the conclusion of each command. Depending on your deployment, you may need to create a new MySQL user or recreate a previous user with access to the newly created database. The command for creating a new MySQL user takes the following form:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> CREATE USER '[username]'@'[host]' IDENTIFIED BY '[password]';\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>In the next example, we will create a user named\u00a0<code>customeradmin<\/code>:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>CREATE USER 'customeradmin'@'localhost' IDENTIFIED BY 's3cr1t';\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>Now we will give\u00a0<code>customeradmin<\/code>\u00a0privileges to access the\u00a0<code>customer<\/code>\u00a0database. The command for granting privileges to a database for a specific user takes the following form:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> GRANT [privilegeType] ON [databaseName].[tableName] TO '[username]'@'[host]'\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>For the purposes of the following example, we will give\u00a0<code>customeradmin<\/code>\u00a0full access to the\u00a0<code>customer<\/code>\u00a0database. Issue the following command in the MySQL client:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> GRANT ALL ON customer.* TO 'customeradmin'@'localhost';\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>You may need to specify different access grants depending on the demands of your deployment. Consult the official documentation for\u00a0MySQL\u2019s GRANT statement. Once the destination database and MySQL user have been created, you can close the MySQL client with the following command:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> quit\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<li>You can now use the\u00a0<code>mysql<\/code>\u00a0command to restore your SQL file. The form of this command resembles the following:\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre> mysql -u [username] -p[password] -h [host] [databaseName] &lt; [filename].sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/li>\n<\/ol>\n<p>In the following example, we will restore the\u00a0<code>customer<\/code>\u00a0database from a SQL backup file named\u00a0<code>customerBackup.sql<\/code>\u00a0(pay special attention to the\u00a0<code>&lt;<\/code>\u00a0symbol in this command):<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p -h localhost customer &lt; customerBackup.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for the root MySQL user\u2019s password. Once the correct credentials are supplied, the restoration process will begin. The duration of this operation depends on your system\u2019s load and the size of the database that you are restoring. It may complete in a few seconds, or it may take many hours.<\/p>\n<h2 id=\"restoring-a-single-table-from-backup\">Restoring a Single Table from Backup<\/h2>\n<h3 id=\"option-1-restoring-a-single-table-using-the-mysql-and-backups-created-by-mysqldump\">Option 1: Restoring a Single Table Using the MySQL and Backups Created by mysqldump<\/h3>\n<p>Before beginning the restoration process, we assume that your MySQL instance already has an existing database that can receive the table you wish to restore. If your MySQL instance does not have the required database, we\u2019ll need to create it before proceeding. First, log into your MySQL instance with the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p -h localhost\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for the root MySQL user\u2019s password. After you have provided the correct credentials, you must create the destination database. For the purpose of this example we will create the\u00a0<code>customer<\/code>\u00a0database and exit the\u00a0<code>mysql<\/code>\u00a0prompt by issuing the following statements:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>CREATE DATABASE customer;\n    quit\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>If you already have the required database, you can safely skip the above step. To continue with the table restoration, issue a command in the following form:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u [username] -p[password] -h [host] [databaseName] &lt; [filename].sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>For the following, example, we will restore the\u00a0<code>order<\/code>\u00a0table into the existing\u00a0<code>customer<\/code>\u00a0database from an SQL backup file named\u00a0<code>customerOrderBackup.sql<\/code>. Be very careful to use the\u00a0<code>&lt;<\/code>\u00a0operator in the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p -h localhost customer &lt; customerOrderBackup.sql\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for the root MySQL user\u2019s password. Once the correct credentials are supplied, the restoration process will begin. The duration of this operation depends on your system\u2019s load and the size of the table that you are restoring. It may complete in a few seconds, or it may take many hours.<\/p>\n<h3 id=\"option-2-restoring-a-single-table-using-the-mysql-client-and-an-infile-statement-for-backups-created-with-outfile\">Option 2: Restoring a Single Table Using the MySQL Client and an INFILE Statement for Backups Created with OUTFILE<\/h3>\n<p>Before beginning the restoration process, we assume that your MySQL instance already has an existing database that can receive the table you wish to restore. If your MySQL instance does not have the required database, we\u2019ll need to create it before proceeding. First, log into your MySQL instance with the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p -h localhost\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for the root MySQL user\u2019s password. After you have provided the correct credentials, you must create the destination database. For the purpose of this example we will create the\u00a0<code>customer<\/code>\u00a0database and exit the\u00a0<code>mysql<\/code>\u00a0prompt by issuing the following statements:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>CREATE DATABASE customer;\n    quit\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The data backup used in this case was created using the\u00a0<code>SELECT * INTO OUTFILE 'backupFile.sql' FROM tableName<\/code>\u00a0command. This type of backup only retains the data itself so the table structure must be recreated. To restore a single table from within the MySQL client, you must first prepare the destination database and table. Log in to your (new) MySQL instance using the MySQL client:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>mysql -u root -p -h localhost\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You will be prompted for the root MySQL user\u2019s password. Once the correct credentials are supplied, you must create the destination database. In this case, we will create the\u00a0<code>customer<\/code>\u00a0database. Issue the following statement:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>CREATE DATABASE customer;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Remember that the semi-colons (e.g.\u00a0<code>;<\/code>) following each statement are required. Now you must create the destination table with the correct structure. The data types of the fields of the table must mirror those of the table where the backup originated. In this example, we will restore the\u00a0<code>order<\/code>table of the\u00a0<code>customer<\/code>\u00a0database. There are 2 fields in the\u00a0<code>order<\/code>\u00a0table,\u00a0<code>custNum<\/code>\u00a0with data type\u00a0<code>INT<\/code>and\u00a0<code>orderName<\/code>\u00a0with data type\u00a0<code>VARCHAR(20)<\/code>; your table structure will be different:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1\n2<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>USE customer;\nCREATE TABLE order (custNum INT, orderName VARCHAR(20));\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Depending on your deployment, you may need to create a new MySQL user or recreate a previous user with access to the newly created database. The command for creating a new MySQL user takes the following form:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>CREATE USER '[username]'@'[host]' IDENTIFIED BY '[password]';\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In the next example, we will create a user named\u00a0<code>customeradmin<\/code>:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>CREATE USER 'customeradmin'@'localhost' IDENTIFIED BY 's3cr1t';\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Now we will give\u00a0<code>customeradmin<\/code>\u00a0privileges to access the\u00a0<code>customer<\/code>\u00a0database. The command for granting privileges to a database for a specific user takes the following form:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>GRANT [privilegeType] ON [databaseName].[tableName] TO '[username]'@'[host]'\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>For the purposes of the following example, we will give\u00a0<code>customeradmin<\/code>\u00a0full access to the\u00a0<code>customer<\/code>database. Issue the following command in the MySQL client:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>GRANT ALL ON customer.* TO 'customeradmin'@'localhost';\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>You may need to specify different access grants depending on the demands of your deployment. Consult the official documentation for\u00a0MySQL\u2019s GRANT statement. Once the table and user have been created, we can import the backup data from the backup file using the\u00a0<code>LOAD DATA<\/code>\u00a0command. The syntax resembles the following:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>LOAD DATA INFILE '[filename]' INTO TABLE [tableName];\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In the following, example we will restore data from a table from a file named\u00a0<code>customerOrderBackup.sql<\/code>. When MySQL client is given path and filename after\u00a0<code>INFILE<\/code>, it looks in the MySQL data directory for that file. If the filename\u00a0<code>customerOrderBackup.sql<\/code>\u00a0was given, the path would be\u00a0<code>\/var\/lib\/mysql\/customerOrderBackup.sql<\/code>. Ensure that the file you are trying to restore from exists, especially if MySQL generates\u00a0<code>File not found<\/code>\u00a0errors.<\/p>\n<p>To import the data from the\u00a0<code>customerOrderBackup.sql<\/code>\u00a0file located in\u00a0<code>\/var\/lib\/mysql\/<\/code>, issue the following command:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>LOAD DATA INFILE 'customerOrderBackup.sql' INTO TABLE order;\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>This process can take anywhere from a few seconds to many hours depending on the size of your table. The duration of this operation depends on your system\u2019s load and the size of the table that you are restoring. It may complete in a few seconds, or it may take many hours. After you have verified that your data was imported successfully, you can log out:<\/p>\n<div class=\"highlight plaintext\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter gl\">\n<pre class=\"lineno\">1<\/pre>\n<\/td>\n<td class=\"code\">\n<pre>quit\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MySQL is an open source relational database management system (DBMS) which is frequently deployed in a wide assortment of contexts. Most frequently it is deployed as part of the\u00a0LAMP Stack. The database system is also easy to use and highly portable and is, in the context of many applications, extremely efficient. As MySQL is often [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[200],"tags":[219,151,220,221],"class_list":["post-14446","post","type-post","status-publish","format-standard","hentry","category-mysql-2","tag-backup","tag-mysql","tag-restore","tag-sql"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/14446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=14446"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/14446\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=14446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=14446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=14446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}