Home  >  Article  >  Database  >  How to modify MySQL database engine to INNODB

How to modify MySQL database engine to INNODB

怪我咯
怪我咯Original
2017-07-05 11:21:511543browse

This article mainly introduces the method of modifying the database engine of MySQL to INNODB. I hope it will be helpful to you.

For MySQL database, if you want to use transactions and row-level locks, you must use the INNODB engine. If you want to use full-text index , you must use myisam. INNODB is more practical, safe, and more stable but slightly less efficient than MYISAM, but there are some functions that MYISAM does not have. Modify the MySQL engine to INNODB, which can use foreign keys, transactions and other functions with high performance. This article mainly introduces how to modify the MySQL database engine to INNODB, and then we will start to introduce it. First modify my.ini and add under [mysqld]:

default-storage-engine=INNODB

The blue font is the name of the database engine to be specified.

Use sql statements to modify the engine of the built table:

alter table tableName type=InnoDB

My my.ini file is posted below for reference:

[mysqld] 
 
basedir=C:\Program Files\VertrigoServ\Mysql\ 
 
datadir=C:\Program Files\VertrigoServ\Mysql\data\ 
 
port =3306 
 
key_buffer =64M 
 
max_allowed_packet =1M 
 
table_cache =128 
 
sort_buffer_size =512K 
 
net_buffer_length =8K 
 
read_buffer_size =256K 
 
read_rnd_buffer_size =512K 
 
myisam_sort_buffer_size =68M 
 
default-storage-engine=INNODB 
 
[mysqldump] 
 
quick 
 
max_allowed_packet =116M 
 
[mysql] 
 
no-auto-rehash 
 
# Remove the next comment character if you are not familiar with SQL 
 
#safe-updates 
 
[isamchk] 
 
key_buffer =20M 
 
sort_buffer_size =20M 
 
read_buffer =62M 
 
write_buffer =62M 
 
[myisamchk] 
 
key_buffer =20M 
 
sort_buffer_size =20M 
 
read_buffer =62M 
 
write_buffer =62M 
 
[mysqlhotcopy] 
 
interactive-timeout

Follow the above code prompts, we You can successfully modify the MySQL database engine to INNODB. This article is introduced here, I believe it will definitely bring you something!

The above is the detailed content of How to modify MySQL database engine to INNODB. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn