How to set the default storage engine to InnoDB in XAMPP

牧云@^-^@ 提交于 2019-12-18 14:50:45

问题


How do I set the default-storage-engine to InnoDB in Linux XAMPP 1.7.3?


回答1:


The easiest way is just to go to the mysql config file (my.ini in windows, my.cnf in Linux) and just add this:

[mysqld]
default-storage-engine=InnoDB

This assumes that you have enabled InnoDB, which is another topic, but there are plenty of answers on how to do this. You can always check the default storage engine in phpMyAdmin on XAMPP: Just click on the server, then on engines, then on a particular engine (like MyISAM), and then see if it says MyISAM is the default storage engine on this MySQL server.




回答2:


You set the default storage engine in the MySQL configuration, but that will only apply to tables that are created after that point. You'll need to alter any tables that aren't InnoDB manually like this. If you have lots of data, this can take a while because it will create the new table, insert all the records and then drop the old table leaving this one in it's place.

ALTER TABLE table_name ENGINE = INNODB;


来源:https://stackoverflow.com/questions/2286813/how-to-set-the-default-storage-engine-to-innodb-in-xampp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!