如何在XAMPP中将默认存储引擎设置为InnoDB

时间:2023-02-13 20:15:13

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

如何在Linux XAMPP 1.7.3中将缺省存储引擎设置为InnoDB ?

2 个解决方案

#1


17  

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

最简单的方法就是访问mysql配置文件。在windows中的ini,在Linux中的my.cnf)然后加上这个:

[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.

这假定您已经启用了InnoDB,这是另一个主题,但是关于如何实现这一点有很多答案。您可以在phpadmin myon XAMPP中检查默认的存储引擎:单击服务器,然后单击引擎,然后单击特定的引擎(比如MyISAM),然后查看它是否说MyISAM是这个MySQL服务器上的默认存储引擎。

#2


8  

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.

您在MySQL配置中设置了默认的存储引擎,但这只适用于之后创建的表。您将需要手动修改任何不是InnoDB的表。如果您有很多数据,这可能需要一段时间,因为它将创建新表,插入所有记录,然后删除旧表,保留原来的表。

ALTER TABLE table_name ENGINE = INNODB;

#1


17  

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

最简单的方法就是访问mysql配置文件。在windows中的ini,在Linux中的my.cnf)然后加上这个:

[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.

这假定您已经启用了InnoDB,这是另一个主题,但是关于如何实现这一点有很多答案。您可以在phpadmin myon XAMPP中检查默认的存储引擎:单击服务器,然后单击引擎,然后单击特定的引擎(比如MyISAM),然后查看它是否说MyISAM是这个MySQL服务器上的默认存储引擎。

#2


8  

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.

您在MySQL配置中设置了默认的存储引擎,但这只适用于之后创建的表。您将需要手动修改任何不是InnoDB的表。如果您有很多数据,这可能需要一段时间,因为它将创建新表,插入所有记录,然后删除旧表,保留原来的表。

ALTER TABLE table_name ENGINE = INNODB;