Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

While doing restore from a MySQL binary log file, it is failing with the following error .

mysqlbinlog mysql-bin.000036 | mysql -u root -p asdb
ERROR 1032 (HY000) at line 48: Can't find record in 'dlfilerank'

The error is after a full database backup using mysqldump.

The table dlfilerank in question is used by liferay CMS which seems to keep inconsistent data. The table is used to keep track of recently downloaded files, which is displayed in the Recent Downloads portlet.

I thought one way to resolve this issue is to delete all records from this table before restoring from binary log file . But this lead to restore failing with a different error.

mysqlbinlog mysql-bin.000036 | mysql -u root -p asdb
ERROR 1062 (23000) at line 387: Duplicate entry '768524' for key 'PRIMARY'

Next I am thinking to delete this table from both mysqldump and binary log file . It will be easy to delete the table after restoring to mysql database , but not sure how to delete db transactions for this table from binary log . Any suggestions how I can I do this . Also , will this approach will resolve the problem mentioned in original description .

share|improve this question
    
Why, specifically, are you trying to restore from the binlog? Using a binlog requires you to FIRST restore from a mysqldump backup, and THEN to start with the precise coordinates within the correct binlog that corresponds to where your original server's binlog coordinates were, when the mysqldump backup started. Here, you are starting from the beginning of "mysql-bin.000036" and what you haven't shown here is how you know this is the correct position and the correct binlog that you should be using. If you were using the correct position of the correct log, you should not see the errors. –  Michael - sqlbot Feb 19 at 23:42
    
Sorry , I forget to mention this in original description. The steps mentioned above are after a full backup taken using mysqldump. The co-ordinates should be correct as I determined the correct co-ordinates through another thread in this group. –  Zama Ques Feb 20 at 5:29
    
You almost certainly need to be specifying a byte position in the binlog with the -j or --start-position= option, using information you captured at the start of the dump process. Again, though, it still isn't clear what you are actually trying to accomplish so it is difficult to determine whether your approach is correct. I would suggest that you talk more about the actual problem rather than the solution you are attempting. –  Michael - sqlbot Feb 20 at 6:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.