0

I'm trying to update the MYSQL DB for an older wordpress/woocommerce site that's currently using MyISAM by switching the engine type to InnoDB. The issue I'm having using Alter Table is that there's a number of tables that have a zero date set as the default value, which SQL is not allowing me to change to null.

I don't want to set mysql to ignore the error since it's been deprecated and will likely cause additional problems down the road. Any suggestions would be appreciated.

Also, should I be concerned about causing conflicts by converting all tables to InnoDB from MyISAM?

asked Aug 11, 2018 at 14:53
2
  • What was the strict mode? Is this relevant: MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value ? Commented Aug 24, 2018 at 23:18
  • Check for other issues here: mysql.rjweb.org/doc.php/myisam2innodb Commented Aug 24, 2018 at 23:18

1 Answer 1

2

It would be great if your provide the table schema and mention the column name.

But you can follow this method to mitigate this.

  1. Get the table schema
  2. Create a new table with the same schema, but the engine=InnoDB.
  3. Insert into the new table using select * from the MyISAM table.
  4. Rename the current table as tbl_older
  5. Rename the new table as the actual name.
answered Aug 12, 2018 at 7:53
1
  • Also, what is the history of the MyISAM table? Probably it was created before you upgraded to 5.7? Did you run mysql_upgrade? (There are several places where something might have happened, not just the change from MyISAM to InnoDB.) Commented Aug 24, 2018 at 23:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.