In general, MySQL provides a variety of storage engines by default, which can be viewed as follows: 1) Check whether the InnoDB plug-in is installed in MySQL. From the command results below, we can see that the innodb plug-in has been installed. mysql> show plugins; +------------+--------+----------------+---------+---------+ | Name | Status | Type | Library | License | +------------+--------+----------------+---------+---------+ | binlog | ACTIVE | STORAGE ENGINE | NULL | GPL | | partition | ACTIVE | STORAGE ENGINE | NULL | GPL | | CSV | ACTIVE | STORAGE ENGINE | NULL | GPL | | MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL | | InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL | | MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL | | MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL | +------------+--------+----------------+---------+---------+ 7 rows in set (0.00 sec) ---------------------------------------------------------------------- 2) Check what storage engines MySQL currently provides: mysql> show engines; +------------+---------+------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+------------------------------------------------------------+--------------+------+------------+ | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | | InnoDB | YES | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | +------------+---------+------------------------------------------------------------+--------------+------+------------+ 5 rows in set (0.00 sec) 3) View the current default storage engine of MySQL: mysql> show variables like '%storage_engine%'; +----------------+--------+ | Variable_name | Value | +----------------+--------+ | storage_engine | MyISAM | +----------------+--------+ 1 row in set (0.00 sec) 4) Check what engine a table uses (the parameter after engine in the displayed results indicates the storage engine currently used by the table): mysql> show create table table name; mysql> show create table wx_share_log; +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | wx_share_log | CREATE TABLE `wx_share_log` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'WeChat sharing log auto-increment ID', `reference_id` int(11) NOT NULL COMMENT 'Recommended broker id', `create_time` datetime NOT NULL COMMENT 'Creation time', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) 5) How to import the MyISAM database into the INNODB engine format: In the backed up xxx.sql file, change ENGINE=MyISAM to ENGINE=INNODB 6) Commands for conversion table: mysql> alter table table name engine = innodb; As can be seen above, the storage engine used by this local MySQL is the default MyISAN. Due to business needs, its storage engine must be changed to Innodb first. The operation record is as follows: 1) Shut down MySQL in safe mode [root@dev mysql5.1.57]# mysqladmin -uroot -p shutdown 2) Back up my.cnf [root@dev mysql5.1.57]# cp my.cnf my.cnf.old 3) Modify the my.cnf configuration file [root@dev mysql5.1.57]# vim my.cnf 4) Delete ib_logfile0 and ib_logfile1 in the /mysql/data directory. Delete it or cut it somewhere else. [root@dev var]# mv ib_logfile0 ib_logfile1 /tmp/back/ 5) Start MySQL and log in to MySQL to verify whether the storage engine has been switched [root@dev var]# /Data/app/mysql5.1.57/bin/mysqld_safe --defaults-file=/Data/app/mysql5.1.57/my.cnf & mysql> show variables like '%storage_engine%'; +----------------+--------+ | Variable_name | Value | +----------------+--------+ | storage_engine | InnoDB | +----------------+--------+ 1 row in set (0.00 sec) The above summary of the operation record of replacing MyISAM storage engine with Innodb in Mysql is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Several ways to generate unique IDs in JavaScript
>>: Detailed explanation of Nginx regular expressions
Introduction Use simple jQuery+CSS to create a cus...
Table of contents 1. New II. Modification element...
Table of contents First of all, you need to know ...
Create a project directory mkdir php Create the f...
Table of contents Preface 1. What is selenium? 2....
Regarding the connection method between Java and ...
1: Differences in speed and loading methods The di...
Table of contents process Demo Mini Program Backe...
Preface For file or directory permissions in Linu...
Detailed example of getting the maximum value of ...
Configuration Example upstream backend { server b...
Compared with other large databases such as Oracl...
1. Vue--The first vue-cli program The development...
Docker installation Install dependency packages s...
After the form is submitted, the returned HTML pag...