Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of converting MySQL MyISAM Library to InnoDB

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Backup database: mysqldump-u [user]-p [password] [databasename] > [dbfile.sql] # back up the database.

2. / usr/local/mysql/bin/mysqladmin-u root-p shutdown # stops the database or service mysql stop.

3. InnoDB table does not support full-text search (fulltext search), so remember to sql the backed-up database and delete the index about Fulltext.

4. Cd / usr/local/mysql/support-files/ looks for the configuration file suitable for the host memory, and will copy the setting file to / etc/my.cnf.

5. Vi / etc/my.cnf, cancel the following annotations. Take my-large.cnf as an example.

Innodb_data_file_path = ibdata1:10M:autoextend

Innodb_buffer_pool_size = 256m

Innodb_additional_mem_pool_size = 20m

Innodb_log_file_size = 5m

Innodb_log_buffer_size = 8m

Innodb_flush_log_at_trx_commit = 1

Innodb_lock_wait_timeout = 50

Plus default-storage-engine=innodb

After adding this section, the phenotype of the new data will be InnoDB, otherwise every time a new data table is added, ENGINE=InnoDB will have to be added after SQL.

6. Change the sql you just backed up and change ENGINE=MyISAM to ENGINE=InnoDB.

7. / usr/local/mysql/bin/safe_mysqld-- user=mysql &, or service mysql start starts the database

8. Create a new database (the database name is the same as the backup database name).

9. Mysql-u [user]-p [password] [database_name] < [dbfile] # import the modified data into the database!

Description:

* the selection of the setting file is based on the memory size.

My-huge.cnf-1G~2G, my-large.cnf-512m, my-medium.cnf-32m-64m, my-small.cnf

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report