Hibernate:MySQLDialect和MySQLInnoDBDialect有什么区别?

时间:2022-01-18 20:08:13

What's the difference between MySQLDialect and MySQLInnoDBDialect? I've used MySQLDialect ever since, now I wonder how the above are different.

MySQLDialect和MySQLInnoDBDialect有什么区别?从那时起我就一直使用MySQLDialect,现在我想知道上面的内容是如何不同的。

Anyone?

任何人?

1 个解决方案

#1


10  

The default storage engine in MySQL is MyISAM. If you need transactions and row-level locking, you often chose InnoDB.

MySQL中的默认存储引擎是MyISAM。如果您需要事务和行级锁定,您通常会选择InnoDB。

Using MySQLInnoDBDialect, Hibernate appends type=InnoDB to the table creation statement. This explicitly creates an InnoDB table. MySQLDialect does not append an engine string, thus, would create a MyISAM table.

使用MySQLInnoDBDialect,Hibernate将type = InnoDB附加到表创建语句。这显式创建了一个InnoDB表。 MySQLDialect不附加引擎字符串,因此会创建一个MyISAM表。

However, you can also change the default storage engine of the MySQL server by using the following line in your my.cnf, MySQL configuration, file.

但是,您也可以使用my.cnf,MySQL配置文件中的以下行更改MySQL服务器的默认存储引擎。

default-storage-engine=innodb

#1


10  

The default storage engine in MySQL is MyISAM. If you need transactions and row-level locking, you often chose InnoDB.

MySQL中的默认存储引擎是MyISAM。如果您需要事务和行级锁定,您通常会选择InnoDB。

Using MySQLInnoDBDialect, Hibernate appends type=InnoDB to the table creation statement. This explicitly creates an InnoDB table. MySQLDialect does not append an engine string, thus, would create a MyISAM table.

使用MySQLInnoDBDialect,Hibernate将type = InnoDB附加到表创建语句。这显式创建了一个InnoDB表。 MySQLDialect不附加引擎字符串,因此会创建一个MyISAM表。

However, you can also change the default storage engine of the MySQL server by using the following line in your my.cnf, MySQL configuration, file.

但是,您也可以使用my.cnf,MySQL配置文件中的以下行更改MySQL服务器的默认存储引擎。

default-storage-engine=innodb