Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2015
    Posts
    1

    Unanswered: Mysql corrupt row

    Hi,
    I have a mysql database which is innoDB and there is one row in the database which makes Mysqld crash every time I try to access it. Does anyone know of a way I could remove this row? If I do a DELETE...

    DELETE FROM table_name WHERE id = <row_id>

    MySQL crashes too... any thoughts on how I might get rid of it?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Without knowing more about the problem, I'd suggest the obvious answer. Create a new_table with the same schema as table_name, then:
    Code:
    INSERT INTO new_table
       SELECT *
          FROM table_name
          WHERE  id < <row_id>
       UNION SELECT *
          FROM table_name
          WHERE id > <row_id>
    After you have all of the data (except the offending row), swap the table names.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •