How to change the MySQL database engine to INNODB

Source: Internet
Author: User

ForMySQL databaseIf you want to use transactions and row-level locks, you must useINNODBEngine. If you want to use full-text indexes, you must use myisam. INNODB is more practical, secure, and stable, but less efficient than MYISAM. However, some functions are not available in MYISAM. Modify MySQL engine to INNODB. You can use foreign keys, transactions, and other functions with high performance. This article describes how to modifyMySQL Database EngineThis is INNODB. Next we will introduce it.

First, modify my. ini and add the following under [mysqld:

 
 
  1. default-storage-engine=INNODB 

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

Use SQL statements to modify the engine of a table:

 
 
  1. alter table tableName type=InnoDB  

My. ini file for reference (http://www.my400800.cn) is posted below ):

 
 
  1. [mysqld]  
  2.  
  3. basedir=C:\Program Files\VertrigoServ\Mysql\  
  4.  
  5. datadir=C:\Program Files\VertrigoServ\Mysql\data\  
  6.  
  7. port =3306 
  8.  
  9. key_buffer =64M 
  10.  
  11. max_allowed_packet =1M 
  12.  
  13. table_cache =128 
  14.  
  15. sort_buffer_size =512K 
  16.  
  17. net_buffer_length =8K 
  18.  
  19. read_buffer_size =256K 
  20.  
  21. read_rnd_buffer_size =512K 
  22.  
  23. myisam_sort_buffer_size =68M 
  24.  
  25. default-storage-engine=INNODB 
  26.  
  27. [mysqldump]  
  28.  
  29. quick  
  30.  
  31. max_allowed_packet =116M 
  32.  
  33. [mysql]  
  34.  
  35. no-auto-rehash  
  36.  
  37. # Remove the next comment character if you are not familiar with SQL  
  38.  
  39. #safe-updates  
  40.  
  41. [isamchk]  
  42.  
  43. key_buffer =20M 
  44.  
  45. sort_buffer_size =20M 
  46.  
  47. read_buffer =62M 
  48.  
  49. write_buffer =62M 
  50.  
  51. [myisamchk]  
  52.  
  53. key_buffer =20M 
  54.  
  55. sort_buffer_size =20M 
  56.  
  57. read_buffer =62M 
  58.  
  59. write_buffer =62M 
  60.  
  61. [mysqlhotcopy]  
  62.  
  63. interactive-timeout 

Follow the prompts in the above Code to successfully modify the MySQL database engine to INNODB. This article will introduce you here. If you want to learn more about MySQL databases, read the article here: http://database.51cto.com/mysql/. I believe it will surely bring you a harvest!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.