简体   繁体   中英

Change MySQL default table engine from MyISAM to InnoDB

I have MySQL running on my machine configured with MyISAM as its default tables. Now I want to ask few of questions:

1) If I change the default table to InnoDB in the configuration file (my.conf), clear the log file and restart mysql, would that harm any of my previous database or tables?

2) If I alter few tables' engine to InnoDB using the following command, would that affect its data at all?

ALTER TABLE table_name ENGINE = InnoDB; 

3) Is it a good idea to keep few tables as MyISAM (for read and write) and the rest as InnoDB (more for selecting data) or is it preferred to select one engine for all the tables in the database?

2) It will only affect the internal representation. Nothing that you will notice on the outside.

3) It is a perfectly good idea, if it enhances performance.

2) You can mix database types. ie innoDB and MyISAM. 3) innoDB supposedly keeps data safer. I think it is the default on latest versions of mySQL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM