Mysql backup and restore from ib_logfile failure

Here's the case:

After a computer has been compromised, we aim to copy all data to another computer.

As a result, mysql databases are not backed up as a SQL query.

We have backed up all physical files / folders on the C drive to the new computer.

For example:

C: \ Program Files \ MySQL \ MySQL Server 4.1 \ data p>

In this case, all data for mysql is inside an unreadable file. The internal data folder consists of files such as ib_logfile0, ib_logfile1, but not ib_data1 The entire database table format is inside each corresponding folder. (Some folders have .frm, .opt) (Other folder has .frm, .myd, .myi)

How to recover data from a database on a new computer?

I tried to install the exact same version of mysql (4.1) on a new computer and then replace all backup files inside the data folder with this mysql on the new computer. Then restart the mysql service.

When I reboot it doesn't work: Failed to start mysql service on local machine. error 1067: The process terminated unexpectedly.

Error log:

InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
090930 10:24:49  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Error: log file .\ib_logfile0 is of different size 0 87031808 bytes
InnoDB: than specified in the .cnf file 0 25165824 bytes!
090930 10:24:49 [ERROR] Can't init databases
090930 10:24:49 [ERROR] Aborting

090930 10:24:49 [Note] C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqld-nt: Shutdown complete

      

+2


source to share


3 answers


your error log indicates that your innodb version doesn't match your innodb files. you need to look at the config file on your old server to figure out where mysql was configured to store your innodb files. then find those files and copy them to the new server. you should also copy the innodb config settings exactly from the old server and apply them to the new server.



0


source


you need to look at the mysql.err log in the data folder to see what is wrong.

is the mysql service started correctly when you first installed it?



it looks like you are on windows, so I'm going to assume that you moved the files, not copied them. when moving files to Windows, they retain their permissions. when copied, they inherit the permissions from the folder. so make sure they have the rights.

0


source


It looks like your innodb_log_file_size in my.ini was not the same as before.

Look at the file ib_logfile0 in the data folder and if it is 102,400 KB it should be: innodb_log_file_size = 100M

Yours looks like this: innodb_log_file_size = 83M (now set to 24M)

I had this problem when someone used the installer to "repair" a mysql installation.

Enjoy.

0


source







All Articles