{"id":1428,"date":"2011-08-10T11:58:36","date_gmt":"2011-08-10T08:58:36","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=1428"},"modified":"2026-04-14T10:27:30","modified_gmt":"2026-04-14T07:27:30","slug":"mysql-%d0%b8-backup","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=1428","title":{"rendered":"[mysql] \u0411\u044d\u043a\u0430\u043f, \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0431\u0430\u0437\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438"},"content":{"rendered":"<p>\u0412\u0441\u0451 \u043d\u0443\u0436\u043d\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u044c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 <strong>mysql<\/strong>. \u041d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e?<\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0430\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <strong>mysqldump<\/strong>, \u043d\u043e \u043e\u043d\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043c\u043f\u0430 (\u0434\u043b\u044f <strong>InnoDB<\/strong> \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>&#8211;single-transaction<\/strong> \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435\u00a0<strong>mysqldump<\/strong>), \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0414\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043c\u043f\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e.\u00a0\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0443\u0442\u0438\u043b\u0438\u0442\u0443.<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0436\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e? \u0427\u0442\u043e \u0442\u043e\u0433\u0434\u0430?<\/p>\n<p><!--more-->\u0422\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432.<\/p>\n<p><strong><span style=\"color: #ff0000;\">1) \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0442\u0438\u043f \u0442\u0430\u0431\u043b\u0438\u0446 InnoDB.<\/span><\/strong><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0443\u00a0<strong>Percona xtrabackup<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u044d\u043a\u0430\u043f\u044b \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0412\u043e\u0442 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430.\u00a0\u041e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (<strong>\/var\/lib\/mysql<\/strong>) \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u0441\u043e\u0431\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u043e\u043a <strong>InnoDB<\/strong> \u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u044b. \u041d\u0430 2-\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 (<strong>prepare<\/strong>)<strong> xtrabackup<\/strong> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0433\u043a\u0430 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <strong>InnoDB<\/strong>-\u0434\u0432\u0438\u0436\u043e\u043a \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <strong>crash-recovery<\/strong>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u043e\u0432. \u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <strong>mysql<\/strong>-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u0430 \u0431\u044b \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><strong><span style=\"color: #ff0000;\">2) \u0420\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f.<\/span><\/strong><\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0431\u044d\u043a\u0430\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0431\u0430\u0437 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 (\u0438\u043b\u0438 \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435, \u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 <strong>mysql<\/strong> \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0440\u0442\u0443). \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0442\u0430\u0431\u043b\u0438\u0446, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0411\u0414.<\/p>\n<p><strong><span style=\"color: #ff0000;\">3) Snapshot<\/span><\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0424\u0421 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a: \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0411\u0414 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0424\u0421 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0439 \u0424\u0421. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <strong>zfs<\/strong>.<\/p>\n<p><strong><span style=\"color: #ff0000;\">4) mysqldump (\u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439)<\/span><\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <strong>mysqldump<\/strong>, \u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p><code>#mysqldump --routines --triggers -uUSER -pPASS dbname | bzip2 &gt; dbname.sql.bz2<\/code><\/p>\n<p>, \u0433\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>&#8211;routines<\/strong> &#8211; \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043c\u043f \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f), \u0430 <strong>&#8211;triggers<\/strong> &#8211; \u0442\u0440\u0438\u0433\u0435\u0440\u043e\u0432 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0438 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c). \u041d\u043e \u043f\u0440\u0438 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<br \/>\n\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0432\u0438\u0436\u043a\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 <strong>InnoDB<\/strong> \u0432\u0435\u0441\u044c\u043c\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e. \u0423 <strong>mysqldump<\/strong> \u0435\u0441\u0442\u044c \u043e\u043f\u0446\u0438\u044f\u00a0<strong>&#8211;single-transaction<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 <strong>SQL<\/strong>-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <strong>BEGIN<\/strong> \u043f\u0435\u0440\u0435\u0434 \u0434\u0430\u043c\u043f\u043e\u043c \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0411\u0414, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043c\u043f \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0435\u0439, \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446. \u041d\u043e \u0431\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <strong>single-transaction\u00a0<\/strong>(\u0442\u0443\u0442 \u0435\u0441\u0442\u044c <a href=\"https:\/\/www.percona.com\/blog\/workaround-for-the-reload-flush_tables-privilege-required-problem-when-using-oracle-mysqldump-8-0-32\/\">bug<\/a>, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u0435, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0432 <a href=\"https:\/\/dev.mysql.com\/doc\/relnotes\/mysql\/5.7\/en\/news-5-7-41.html\">5.7.41<\/a> \u0438 8.0.33), \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0435\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u0445. \u0412\u043e\u0442 \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u0437 \u0441\u0430\u0439\u0442\u0430\u00a0percona.com:<\/p>\n<blockquote><p><span style=\"color: #993366;\">Q:\u00a0But if you use the\u00a0\u00a0<span id=\"crayon-58db5c4417bec790248027\" class=\"crayon-syntax crayon-syntax-inline crayon-theme-familiar crayon-theme-familiar-inline crayon-font-monaco\"><span class=\"crayon-pre crayon-code\"><span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-v\">single<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">transaction<\/span><\/span><\/span>\u00a0option for\u00a0<span id=\"crayon-58db5c4417bee769774310\" class=\"crayon-syntax crayon-syntax-inline crayon-theme-familiar crayon-theme-familiar-inline crayon-font-monaco\"><span class=\"crayon-pre crayon-code\"><span class=\"crayon-v\">mysqldump<\/span><\/span><\/span>, you can only specify one character set in the default?<\/span><\/p>\n<p><span style=\"color: #993366;\">A:\u00a0Yes, and this is OK: all data will be converted into this character set. And then, when you will restore the dump, it will be converted back to the character set specified in column definitions.<\/span><\/p><\/blockquote>\n<p>\u041c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0434\u0430\u043c\u043f, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 <strong>pipe<\/strong> \u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0431\u0430\u0437\u0443.<\/p>\n<p><em><span style=\"color: #ff6600;\">&#8211; \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/em><\/p>\n<p><code># nc -4dl 1.1.1.1 6625 |\u00a0gunzip -c | mysql -p mydatabase<\/code><\/p>\n<p>\u0433\u0434\u0435 <strong>1.1.1.1<\/strong> \u0438 <strong>6625<\/strong> &#8211; <strong>IP<\/strong> \u0438 \u043f\u043e\u0440\u0442 \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<p><span style=\"color: #ff6600;\"><em><strong>PS.<\/strong><\/em><\/span> \u041f\u043e\u0434 <strong>linux<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p><code># nc -l -p 6625 |\u00a0gunzip -c | mysql -p mydatabase<\/code><\/p>\n<p><em><span style=\"color: #ff6600;\">&#8211; \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c:<\/span><\/em><\/p>\n<p><code># mysqldump -p mydatabase | gzip -c |\u00a0nc 1.1.1.1 6625<\/code><\/p>\n<p>\u0414\u043b\u044f <strong>MyISAM<\/strong> \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0446\u0438\u0435\u0439\u00a0<strong>&#8211;lock-tables<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>READ LOCAL<\/strong>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b <strong>INSERT<\/strong> \u0432 <strong>MyISAM<\/strong>-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043c\u043f\u0430.<\/p>\n<p><span style=\"color: #ff6600;\"><em><strong>P.S<\/strong><\/em>.<\/span> \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438 \u0434\u0430\u043c\u043f\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>mysqldump<\/strong> \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e\u00a0<strong>&#8211;quick<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043c\u043f\u0435 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 <strong>INSERT&#8217;\u044b<\/strong>, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0446\u0438\u044e\u00a0<strong>skip-extended-insert<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u0438\u0442\u044c \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u0430\u043c\u043f \u0442\u0430\u043a:<\/p>\n<p><code>#\u00a0mysqldump --routines --triggers --lock-tables --single-transaction -uUSER -pPASS dbname | bzip2 &gt; dbname.sql.bz2<\/code><\/p>\n<p><strong><span style=\"color: #ff0000;\">5) \u041f\u0430\u0440\u0430\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0430\u043c\u043f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u0430\u0437 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/span><\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <strong>gnu parallel<\/strong> \u0438\u043b\u0438\u00a0<strong>mk-parallel-dump<\/strong> \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 <a href=\"https:\/\/code.google.com\/p\/maatkit\/\" target=\"_blank\" rel=\"nofollow noopener\">maatkit<\/a><\/p>\n<p><strong><span style=\"color: #ff0000;\">6)\u00a0mydumper<\/span><\/strong><\/p>\n<ul>\n<li><b>mydumper<\/b> is a tool used for backing up MySQL database servers much<br \/>\nfaster than the mysqldump tool distributed with MySQL. It also has the<br \/>\ncapability to retrieve the binary logs from the remote server at the same time<br \/>\nas the dump itself. The advantages of mydumper are:<\/li>\n<li>Parallelism (hence, speed) and performance (avoids expensive character set conversion routines, efficient code overall)<\/li>\n<li>Easier to manage output (separate files for tables, dump metadata, etc, easy to view\/parse data)<\/li>\n<li>Consistency &#8211; maintains snapshot across all threads, provides accurate master and slave log positions, etc<\/li>\n<li>Manageability &#8211; supports PCRE for specifying database and tables inclusions and exclusions<\/li>\n<\/ul>\n<p><span style=\"color: #ff0000;\"><strong>7) \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/strong><\/span><\/p>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 <a href=\"https:\/\/www.percona.com\/blog\/2018\/02\/22\/restore-mysql-logical-backup-maximum-speed\/\">\u043e\u0431\u0437\u043e\u0440<\/a> \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>&#8211; <a href=\"https:\/\/habr.com\/ru\/articles\/734824\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 <strong>binlog<\/strong><\/p>\n<p>&#8211; <a href=\"https:\/\/blog.feld.me\/posts\/2016\/09\/speeding-up-mysql-import-on-freebsd\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0441\u0451 \u043d\u0443\u0436\u043d\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u044c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 mysql. \u041d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e? \u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0430\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 mysqldump, \u043d\u043e \u043e\u043d\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043c\u043f\u0430 (\u0434\u043b\u044f InnoDB \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8211;single-transaction \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0435\u00a0mysqldump), \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0414\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043c\u043f\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-1428","post","type-post","status-publish","format-standard","hentry","category-databases"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/1428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1428"}],"version-history":[{"count":16,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/1428\/revisions"}],"predecessor-version":[{"id":6746,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/1428\/revisions\/6746"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}