{"id":682,"date":"2010-06-28T20:04:17","date_gmt":"2010-06-29T01:04:17","guid":{"rendered":"http:\/\/angelsalvadorweb.com\/blogs\/?p=682"},"modified":"2010-06-28T20:04:17","modified_gmt":"2010-06-29T01:04:17","slug":"respaldando-bases-de-datos-con-mysql-dump","status":"publish","type":"post","link":"https:\/\/angelsalvadorweb.com\/mx\/?p=682","title":{"rendered":"Respaldando Bases de datos con MYSQL DUMP"},"content":{"rendered":"<p>Hola, regresando y apoyandolos en un respaldo r\u00e1pido y automatizado con Mysql.<\/p>\n<h3><span style=\"font-weight: normal; font-size: 13px; \">Estos d\u00edas he tenido que hacer la copia de seguridad de mis Base de Datos de MySQL manualmente\u2026 lo he tenido que hacer con el comando mysqldump.<\/span><\/h3>\n<p>En mi caso he tenido que hacer el backup de todas las Base de Datos que tengo y para ello he ejecutado el siguiente comando:<\/p>\n<blockquote>\n<pre style=\"overflow-x: auto; overflow-y: auto; width: 570px; background-color: #09121b; padding: 1em; border: 1px solid #eeeeee;\"><code style=\"font-family: 'Courier New'; font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; color: #aaaaaa;\"><strong><span style=\"color: #00ff00;\">sudo mysqldump -A --password=<\/span><em><span style=\"color: #00ff00;\">CLAVE<\/span><\/em><span style=\"color: #00ff00;\"> --user=<\/span><em><span style=\"color: #00ff00;\">USUARIO<\/span><\/em><span style=\"color: #00ff00;\"> &gt; backupDB_5Enero2010.sql<\/span><\/strong><\/code><\/pre>\n<\/blockquote>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 100px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;\">Se pueden utilizar varios que otras opciones, por ejemplo:<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 100px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;\">1. Copia de Seguridad \u2013 Backup con un comando m\u00e1s simple:<\/div>\n<p>Se pueden utilizar varios que otras opciones, por ejemplo:<\/p>\n<p>1. Copia de Seguridad \u2013 Backup con un comando m\u00e1s simple:<\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><\/p>\n<blockquote>\n<pre style=\"overflow-x: auto; overflow-y: auto; width: 570px; background-color: #09121b; padding: 1em; border: 1px solid #eeeeee;\"><code style=\"font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; color: #aaaaaa;\"><strong><span style=\"color: #00ff00;\">sudo mysqldump --opt &gt; salidaBackup.sql<\/span><\/strong><\/code><\/pre>\n<\/blockquote>\n<p><\/span><\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><strong>2. <\/strong>Copia de seguridad lo m\u00e1s r\u00e1pidamente, ejectivamente de una Base de Datos concreta:<\/span><\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><\/p>\n<blockquote>\n<pre style=\"overflow-x: auto; overflow-y: auto; width: 570px; background-color: #09121b; padding: 1em; border: 1px solid #eeeeee;\"><code style=\"font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; color: #aaaaaa;\"><strong><span style=\"color: #00ff00;\">sudo mysqldump --opt --password=<\/span><em><span style=\"color: #00ff00;\">CLAVE<\/span><\/em><span style=\"color: #00ff00;\"> --user=<\/span><em><span style=\"color: #00ff00;\">USUARIO<\/span><\/em><span style=\"color: #00ff00;\"> <\/span><em><span style=\"color: #00ff00;\">BASEDATOS<\/span><\/em><span style=\"color: #00ff00;\"> &gt; salidaBackup.sql<\/span><\/strong><\/code><\/pre>\n<\/blockquote>\n<p><\/span><\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><strong>3. <\/strong>Copia de seguridad de una sola tabla de una Base de Datos:<\/span><\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><\/p>\n<blockquote>\n<pre style=\"overflow-x: auto; overflow-y: auto; width: 570px; background-color: #09121b; padding: 1em; border: 1px solid #eeeeee;\"><code style=\"font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; color: #aaaaaa;\"><strong><span style=\"color: #00ff00;\">sudo mysqldump --opt --user=<\/span><em><span style=\"color: #00ff00;\">USUARIO<\/span><\/em><span style=\"color: #00ff00;\"> --password=<\/span><em><span style=\"color: #00ff00;\">CLAVE BASEDATOS TABLA<\/span><\/em><span style=\"color: #00ff00;\"> &gt; salitaTabla.sql<\/span><\/strong><\/code><\/pre>\n<\/blockquote>\n<p><\/span><\/p>\n<p>Esto es lo que he podido probar pero se pueden hacer bastantes combinaciones posibles. Ahora veamos como podemos restaurar estas copias de seguridad desde comandos, nuevamente.<\/p>\n<p>Restaurar Copias de Seguridad Backup con mysqldump<\/p>\n<p>Al igual que he explicado en la parte superior, podemos hacer la restauraci\u00f3n del fichero de distintas maneras y utilizando m\u00e1s o menos par\u00e1mentros. Veamos los m\u00e1s utilizados:<\/p>\n<p>1. Comando simple para restaurar un Base de Datos concreta:<\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><\/p>\n<blockquote>\n<pre style=\"overflow-x: auto; overflow-y: auto; width: 570px; background-color: #09121b; padding: 1em; border: 1px solid #eeeeee;\"><code style=\"font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; color: #aaaaaa;\"><strong><span style=\"color: #00ff00;\">sudo mysql BASEDATOS &lt; salidaBackup.sql<\/span><\/strong><\/code><\/pre>\n<\/blockquote>\n<p><\/span><\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><strong>2. <\/strong>Comando con m\u00e1s par\u00e1metros de todos.<\/span><\/p>\n<p><span style=\"font-family: Verdana, Helvetica, sans-serif; line-height: 15px; color: #333333;\"><\/p>\n<blockquote>\n<pre style=\"overflow-x: auto; overflow-y: auto; width: 570px; background-color: #09121b; padding: 1em; border: 1px solid #eeeeee;\"><code style=\"font-size: 1em; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; color: #aaaaaa;\"><strong><span style=\"color: #00ff00;\">sudo mysql user=<\/span><em><span style=\"color: #00ff00;\">USUARIO<\/span><\/em><span style=\"color: #00ff00;\"> --password=<\/span><em><span style=\"color: #00ff00;\">CLAVE BASEDATOS <\/span><\/em><span style=\"color: #00ff00;\">&lt; salitaTabla.sql<\/span><\/strong><\/code><\/pre>\n<\/blockquote>\n<p><\/span><\/p>\n<p>Espero que puedan comentar&#8230; Se dan asesor\u00edas express.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hola, regresando y apoyandolos en un respaldo r\u00e1pido y automatizado con Mysql. Estos d\u00edas he tenido que hacer la copia de seguridad de mis Base de Datos de MySQL manualmente\u2026 lo he tenido que hacer con el comando mysqldump. En&#8230;..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[228,275],"class_list":["post-682","post","type-post","status-publish","format-standard","hentry","category-programacion","tag-mysqldump","tag-respaldo-automatizado-mysql"],"_links":{"self":[{"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=\/wp\/v2\/posts\/682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=682"}],"version-history":[{"count":0,"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=\/wp\/v2\/posts\/682\/revisions"}],"wp:attachment":[{"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/angelsalvadorweb.com\/mx\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}