* [Sysadmins] Копирование баз MySQL @ 2015-04-14 16:14 Vladimir Karpinsky 2015-04-14 16:26 ` Nikolay A. Fetisov 0 siblings, 1 reply; 3+ messages in thread From: Vladimir Karpinsky @ 2015-04-14 16:14 UTC (permalink / raw) To: ALT Linux sysadmins' discussion Здравствуйте! Надо на новый сервер перетащить все настройки и базы MySQL. В связи с этим вопрос: можно ли это сделать установкой соответствующих пакетов с последующим копированием /var/lib/mysql? -- С уважением, Владимир. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Sysadmins] Копирование баз MySQL 2015-04-14 16:14 [Sysadmins] Копирование баз MySQL Vladimir Karpinsky @ 2015-04-14 16:26 ` Nikolay A. Fetisov 2015-04-14 16:43 ` Vladimir Karpinsky 0 siblings, 1 reply; 3+ messages in thread From: Nikolay A. Fetisov @ 2015-04-14 16:26 UTC (permalink / raw) To: ALT Linux sysadmins' discussion В Вт, 14/04/2015 в 19:14 +0300, Vladimir Karpinsky пишет: > Надо на новый сервер перетащить все настройки и базы MySQL. В связи с этим > вопрос: можно ли это сделать установкой соответствующих пакетов с > последующим копированием /var/lib/mysql? > Да, вполне. Если версии MySQL совпадают - базы подхватиться должны, если переписывается _целиком_ /var/lib/mysql/ , с сохранением прав доступа. Копироваться должно, разумеется, при остановленной базе или хотя бы во время 'FLUSH TABLES WITH READ LOCK'. Если базы _целиком_ из таблиц MyISAM - вполне можно переписывать и каталоги отдельных базы. И даже отдельные таблицы. Для InnoDB - только /var/lib/mysql/db/ целиком, для таблиц InnoDB часть описаний лежит вне каталога базы даже при хранении их в отдельных файлах. Единственное, может оказаться, что dump/restore будет быстрее - смотря сколько баз, какие таблицы и индексы, какие машины и через какую сеть оно копируется. -- С уважением, Николай Фетисов ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Sysadmins] Копирование баз MySQL 2015-04-14 16:26 ` Nikolay A. Fetisov @ 2015-04-14 16:43 ` Vladimir Karpinsky 0 siblings, 0 replies; 3+ messages in thread From: Vladimir Karpinsky @ 2015-04-14 16:43 UTC (permalink / raw) To: sysadmins 14.04.2015 19:26, Nikolay A. Fetisov пишет: > В Вт, 14/04/2015 в 19:14 +0300, Vladimir Karpinsky пишет: >> Надо на новый сервер перетащить все настройки и базы MySQL. В связи с этим >> вопрос: можно ли это сделать установкой соответствующих пакетов с >> последующим копированием /var/lib/mysql? > > Да, вполне. Если версии MySQL совпадают - базы подхватиться должны, если > переписывается _целиком_ /var/lib/mysql/ , с сохранением прав доступа. Так и предполагал делать. > Копироваться должно, разумеется, > при остановленной базе или хотя бы во время > 'FLUSH TABLES WITH READ LOCK'. Это не проблема -- вполне могу на время остановить. > Для InnoDB - только /var/lib/mysql/db/ целиком, для таблиц > InnoDB часть описаний лежит вне каталога базы даже при хранении > их в отдельных файлах. Как раз InnoDB, поэтому я до конца не понимаю: где и что храниться. > Единственное, может оказаться, что dump/restore будет > быстрее - смотря сколько баз, какие таблицы и индексы, > какие машины и через какую сеть оно копируется. Я настраивал всё это несколько лет назад, потом оно всё просто работало -- я боюсь, что что-то мог забыть... Если бы не проблема с грубом (http://lists.altlinux.org/pipermail/community/2015-January/683354.html), то вообще можно было бы не возиться :-( Спасибо! -- С уважением, Владимир. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-14 16:43 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-04-14 16:14 [Sysadmins] Копирование баз MySQL Vladimir Karpinsky 2015-04-14 16:26 ` Nikolay A. Fetisov 2015-04-14 16:43 ` Vladimir Karpinsky
ALT Linux sysadmins discussion This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \ sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com public-inbox-index sysadmins Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sysadmins AGPL code for this site: git clone https://public-inbox.org/public-inbox.git