Migrate MyISAM tables to INNODB using mysqldump

Follow

Comments

4 comments

  • Avatar
    David Bennett

    The -R and --triggers options are not needed on the second mysqldump (data) as the functions, stored procedures, and triggers will be migrated in the first (schema) dump.   Recent changes in MySQL may make this even more problematic if your schema phase requires updates to the stored procedures and functions (such as ERROR 1418 validations)

    0
    Comment actions Permalink
  • Avatar
    bastiat666

    Explain sed-i.bak.
    Is that a typo?

    0
    Comment actions Permalink
  • Avatar
    Sofiya Williams

    I like your writing style. This article is helpful for my team. As a team leader, I personally thank you through this comment.MyISAM tables to INNODB

    0
    Comment actions Permalink
  • Avatar
    Delta Executor

    To migrate MyISAM tables to InnoDB using mysqldump,

    1. Dump the Database:

      bash
      Copy code
      mysqldump -u username -p dbname > backup.sql
    2. Replace Storage Engine: Use sed to change MyISAM to InnoDB:

      bash
      Copy code
      sed -i 's/ENGINE=MyISAM/ENGINE=InnoDB/g' backup.sql
    3. Restore the Dump:

      bash
      Copy code
      mysql -u username -p dbname < backup.sql

    This converts all tables to InnoDB.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk