2016-01-08 5 views
0

Я установил полную резервную копию моего сервера strator и должен был использовать «innodb_force_recovery = 1» в my.cnf, чтобы запустить мою базу данных.Как перезапустить mysql после восстановления innodb

I, howewver, не может писать/изменять базу данных/таблицы и требовать изгнать опцию «innodb_force_recovery = 1».

После изъятия, я не могу запустить SQL-сервер. Любая помощь с этим будет принята с благодарностью. Я получаю следующую трассировку стека:

Начиная с innodb_force_recovery = 1

160108 3:28:04 [Note] Event Scheduler: Loaded 0 events 
160108 3:28:04 [Note] /usr/sbin/mysqld: ready for connections. 
Version: '5.5.38-0ubuntu0.14.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) 
160108 3:28:21 [Note] /usr/sbin/mysqld: Normal shutdown 

160108 3:28:21 [Note] Event Scheduler: Purging the queue. 0 events 
160108 3:28:21 InnoDB: Starting shutdown... 
160108 3:28:23 InnoDB: Shutdown completed; log sequence number 946126358 
160108 3:28:23 [Note] /usr/sbin/mysqld: Shutdown complete 

160108 3:28:41 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 
160108 3:28:41 [Note] Plugin 'FEDERATED' is disabled. 
160108 3:28:41 [Warning] option 'innodb-buffer-pool-size': signed value 2097152 adjusted to 5242880 
160108 3:28:41 [Warning] option 'innodb-additional-mem-pool-size': signed value 512000 adjusted to 524288 
160108 3:28:41 InnoDB: The InnoDB memory heap is disabled 
160108 3:28:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
160108 3:28:41 InnoDB: Compressed tables use zlib 1.2.8 
160108 3:28:41 InnoDB: Using Linux native AIO 
160108 3:28:41 InnoDB: Initializing buffer pool, size = 5.0M 
160108 3:28:41 InnoDB: Completed initialization of buffer pool 
160108 3:28:41 InnoDB: highest supported file format is Barracuda. 
160108 3:28:41 InnoDB: Waiting for the background threads to start 
160108 3:28:42 InnoDB: Error: tablespace size stored in header is 4224 pages, but 
160108 3:28:42 InnoDB: the sum of data file sizes is only 3840 pages 
160108 3:28:42 InnoDB: 5.5.38 started; log sequence number 946126358 
160108 3:28:42 InnoDB: !!! innodb_force_recovery is set to 1 !!! 
160108 3:28:42 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 
160108 3:28:42 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 
160108 3:28:42 [Note] Server socket created on IP: '0.0.0.0'. 
160108 3:28:42 [Note] Event Scheduler: Loaded 0 events 
160108 3:28:42 [Note] /usr/sbin/mysqld: ready for connections. 
Version: '5.5.38-0ubuntu0.14.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) 

Перезапуск БЕЗ innodb_force_recovery = 1

160108 3:29:28 [Note] /usr/sbin/mysqld: Normal shutdown 

160108 3:29:28 [Note] Event Scheduler: Purging the queue. 0 events 
160108 3:29:28 InnoDB: Starting shutdown... 
160108 3:29:29 InnoDB: Shutdown completed; log sequence number 946126358 
160108 3:29:29 [Note] /usr/sbin/mysqld: Shutdown complete 

160108 3:29:29 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 
160108 3:29:29 [Note] Plugin 'FEDERATED' is disabled. 
160108 3:29:29 [Warning] option 'innodb-buffer-pool-size': signed value 2097152 adjusted to 5242880 
160108 3:29:29 [Warning] option 'innodb-additional-mem-pool-size': signed value 512000 adjusted to 524288 
160108 3:29:29 InnoDB: The InnoDB memory heap is disabled 
160108 3:29:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
160108 3:29:29 InnoDB: Compressed tables use zlib 1.2.8 
160108 3:29:29 InnoDB: Using Linux native AIO 
160108 3:29:29 InnoDB: Initializing buffer pool, size = 5.0M 
160108 3:29:29 InnoDB: Completed initialization of buffer pool 
160108 3:29:29 InnoDB: highest supported file format is Barracuda. 
160108 3:29:30 InnoDB: Waiting for the background threads to start 
160108 3:29:31 InnoDB: Error: tablespace size stored in header is 4224 pages, but 
160108 3:29:31 InnoDB: the sum of data file sizes is only 3840 pages 
160108 3:29:31 InnoDB: Cannot start InnoDB. The tail of the system tablespace is 
160108 3:29:31 InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an 
160108 3:29:31 InnoDB: inappropriate way, removing ibdata files from there? 
160108 3:29:31 InnoDB: You can set innodb_force_recovery=1 in my.cnf to force 
160108 3:29:31 InnoDB: a startup if you are trying to recover a badly corrupt database. 
160108 3:29:31 [ERROR] Plugin 'InnoDB' init function returned error. 
160108 3:29:31 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
160108 3:29:31 [ERROR] Unknown/unsupported storage engine: InnoDB 
160108 3:29:31 [ERROR] Aborting 

160108 3:29:31 [Note] /usr/sbin/mysqld: Shutdown complete 

160108 3:29:32 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 
160108 3:29:32 [Note] Plugin 'FEDERATED' is disabled. 
160108 3:29:32 [Warning] option 'innodb-buffer-pool-size': signed value 2097152 adjusted to 5242880 
160108 3:29:32 [Warning] option 'innodb-additional-mem-pool-size': signed value 512000 adjusted to 524288 
160108 3:29:32 InnoDB: The InnoDB memory heap is disabled 
160108 3:29:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
160108 3:29:32 InnoDB: Compressed tables use zlib 1.2.8 
160108 3:29:32 InnoDB: Using Linux native AIO 
160108 3:29:32 InnoDB: Initializing buffer pool, size = 5.0M 
160108 3:29:32 InnoDB: Completed initialization of buffer pool 
160108 3:29:32 InnoDB: highest supported file format is Barracuda. 
160108 3:29:32 InnoDB: Waiting for the background threads to start 
160108 3:29:33 InnoDB: Error: tablespace size stored in header is 4224 pages, but 
160108 3:29:33 InnoDB: the sum of data file sizes is only 3840 pages 
160108 3:29:33 InnoDB: Cannot start InnoDB. The tail of the system tablespace is 
160108 3:29:33 InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an 
160108 3:29:33 InnoDB: inappropriate way, removing ibdata files from there? 
160108 3:29:33 InnoDB: You can set innodb_force_recovery=1 in my.cnf to force 
160108 3:29:33 InnoDB: a startup if you are trying to recover a badly corrupt database. 
160108 3:29:33 [ERROR] Plugin 'InnoDB' init function returned error. 
160108 3:29:33 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
160108 3:29:33 [ERROR] Unknown/unsupported storage engine: InnoDB 
160108 3:29:33 [ERROR] Aborting 

160108 3:29:33 [Note] /usr/sbin/mysqld: Shutdown complete 

160108 3:29:34 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead. 
160108 3:29:34 [Note] Plugin 'FEDERATED' is disabled. 
160108 3:29:34 [Warning] option 'innodb-buffer-pool-size': signed value 2097152 adjusted to 5242880 
160108 3:29:34 [Warning] option 'innodb-additional-mem-pool-size': signed value 512000 adjusted to 524288 
160108 3:29:34 InnoDB: The InnoDB memory heap is disabled 
160108 3:29:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
160108 3:29:34 InnoDB: Compressed tables use zlib 1.2.8 
160108 3:29:34 InnoDB: Using Linux native AIO 
160108 3:29:34 InnoDB: Initializing buffer pool, size = 5.0M 
160108 3:29:34 InnoDB: Completed initialization of buffer pool 
160108 3:29:34 InnoDB: highest supported file format is Barracuda. 
160108 3:29:34 InnoDB: Waiting for the background threads to start 
160108 3:29:35 InnoDB: Error: tablespace size stored in header is 4224 pages, but 
160108 3:29:35 InnoDB: the sum of data file sizes is only 3840 pages 
160108 3:29:35 InnoDB: Cannot start InnoDB. The tail of the system tablespace is 
160108 3:29:35 InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an 
160108 3:29:35 InnoDB: inappropriate way, removing ibdata files from there? 
160108 3:29:35 InnoDB: You can set innodb_force_recovery=1 in my.cnf to force 
160108 3:29:35 InnoDB: a startup if you are trying to recover a badly corrupt database. 
160108 3:29:35 [ERROR] Plugin 'InnoDB' init function returned error. 
160108 3:29:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
160108 3:29:35 [ERROR] Unknown/unsupported storage engine: InnoDB 
160108 3:29:35 [ERROR] Aborting 

160108 3:29:35 [Note] /usr/sbin/mysqld: Shutdown complete 
+0

И ответ на вопросы в журнале? –

ответ

0

innodb_force_recovery «s цель состоит в том, чтобы начать MySQL в Read- только режим и данные пользователя. В редких случаях его можно использовать для излечения табличного пространства (например, для удаления поврежденного индекса), но это скорее исключение.

Когда вы взяли дамп, вы должны остановить MySQL, переместить существующие файлы MySQL в архив и заново создать базы данных из дампа.

# service mysql stop 
# sed -i 's/innodb_force_recovery=[1-6]/innodb_force_recovery=0' /etc/my.cnf 
# mv /var/lib/mysql /var/lib/mysql.archive 
# mkdir /var/lib/mysql 
# chown -R mysql:mysql /var/lib/mysql 
# service mysql start 
# mysql < dump.sql