简体   繁体   English

MySQL InnoDB从备份中恢复

[英]MySQL InnoDB recovering from backup

Recently my server crushed to the ground, but luckily I had full backup of the server's drive. 最近,我的服务器崩溃了,但是幸运的是,我对服务器的驱动器进行了完整备份。 My server is running Windows server 2008 and Plesk 9.5. 我的服务器正在运行Windows Server 2008和Plesk 9.5。

In order to restore my database, I followed the instructions: replace all ib_logfile0 , ib_logfile1 , ibdata1 and add the .frm s/ .MYI / .MYD . 为了恢复数据库,我遵循以下指示信息:替换所有ib_logfile0ib_logfile1ibdata1并添加.frm s / .MYI / .MYD

The files has been replaced, and mysql was restarted. 文件已被替换,并且mysql重新启动。 I've got the following error: 我遇到以下错误:

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10489229 bytes
InnoDB: than specified in the .cnf file 0 10485760 bytes!
121206 19:53:26 [ERROR] Default storage engine (InnoDB) is not available
121206 19:53:26 [ERROR] Aborting
121206 19:53:26 [Note] C:\Program Files (x86)\Parallels\Plesk\Databases\MySQL\bin\mysqld-nt.exe: Shutdown complete

The my.ini file has the following options: my.ini文件具有以下选项:

[client]
port=3306

[mysql]
default-character-set=latin1

[mysqld]
port=3306
basedir="C:/Program Files (x86)/Parallels/Plesk/Databases/MySQL/"
datadir="C:/Program Files (x86)/Parallels/Plesk/Databases/MySQL/Data/"
default-character-set=latin1
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=100
query_cache_size=0
table_cache=256
tmp_table_size=35M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=69M
key_buffer_size=55M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=3M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=2M
innodb_buffer_pool_size=107M
innodb_log_file_size=10489229
innodb_thread_concurrency=10

Please help me, I've been trying different methods since last weeks and has devoted around 25 hours to it, your help will be fully welcomed! 请帮助我,自上周以来我一直在尝试不同的方法,并花了大约25个小时来竭诚欢迎您的帮助!

I'm sorry for my English. 我的英语不好意思。

The InnoDB log file has a different but similar size (read the error output!). InnoDB日志文件的大小不同但相似(请阅读错误输出!)。 InnoDB won't start with such a discrepancy. InnoDB不会以这种差异开头。 Your options: 您的选择:

  • Edit the my.cnf file to match the current (reported) size. 编辑my.cnf文件以匹配当前(报告的)大小。 If the log file is corrupt in some way, this is a bad thing to do. 如果日志文件以某种方式损坏,这是一件坏事。
  • Remove the iblog files and let InnoDB recreate them at the start of MySQL. 删除iblog文件,并让InnoDB在MySQL开始时重新创建它们。 You may loose some data if you took a snapshot when running the backup. 如果在运行备份时拍摄了快照,则可能会丢失一些数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM