Converting myisam to innodb requires modifying the storage engine of the table. If you do not modify myisam to innodb according to the standard method, it may cause database damage and data loss. Let’s look at the correct myisam conversion. innodb method.
<script>ec(2);</script>
Here is a brief introduction to the differences and conversion methods between the two:
MyISAM: MyISAM is the default database storage engine for versions prior to MySQL5.5. MYISAM provides high-speed storage and retrieval, as well as full-text search capabilities, and is suitable for applications with frequent queries such as data warehouses. But it does not support transactions or foreign keys. An important flaw of the MyISAM format is that data cannot be restored after the table is damaged.
InnoDB: InnoDB is the default database storage engine of MySQL version 5.5. However, InnoDB has been acquired by Oracle. Falcon, a new storage engine developed by MySQL, will be introduced in MySQL version 6.0. InnoDB is transaction safe with commit, rollback and crash recovery capabilities. However, compared to the MyISAM storage engine, InnoDB writes less efficiently and takes up more disk space to retain data and indexes. Nonetheless, InnoDB includes support for transactions and foreign keys, both of which are not available in the MyISAM engine.
MyISAM is suitable for: (1) Doing a lot of count calculations; (2) Insertions are infrequent and queries are very frequent; (3) There are no transactions.
InnoDB is suitable for: (1) situations where reliability requirements are relatively high, or transactions are required; (2) table updates and queries are quite frequent, and the chance of table locking is relatively high. (4) Servers with better performance, such as separate database servers, such as Alibaba Cloud's relational databaseRDS, recommend the InnoDB engine.
MySQL generally provides a variety of storage engines, which can be viewed by executing the following instructions:
First enter MySQLCommand line mode
View what storage MySQL provides Engine:
mysql> show engines;
View MySQL's current default storage engine:
mysql> show variables like '%storage_engine%';
Query wpsql library
mysql> use wpsql;
List all table names in the current library
mysql> show tables;
You need to see what engine is used for the wp_posts table (in the display results, the parameter after the engine It indicates the storage engine currently used by the table):
mysql> show create table wp_posts;
Modify the wp_posts table to the InnoDB storage engine (you can also use this command to replace InnoDB with MyISAM):
mysql> ALTER TABLE wp_posts ENGINE=INNODB;
If you want to change the storage engine of the entire database table, you generally need to modify one table by one, which is relatively cumbersome. You can export the database first, get SQL, and replace all MyISAM with INNODB. , and thenimport the database way.
Restart mysql after the conversion is completed
> service mysqld restart
The above is the detailed content of Example tutorial of converting myisam to innodb in MySQL. For more information, please follow other related articles on the PHP Chinese website!

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

InnoDB是一个将表中的数据存储到磁盘上的存储引擎,所以即使关机后重启我们的数据还是存在的。而真正处理数据的过程是发生在内存中的,所以需要把磁盘中的数据加载到内存中,如果是处理写入或修改请求的话,还需要把内存中的内容刷新到磁盘上。而我们知道读写磁盘的速度非常慢,和内存读写差了几个数量级,所以当我们想从表中获取某些记录时,InnoDB存储引擎需要一条一条的把记录从磁盘上读出来么?InnoDB采取的方式是:将数据划分为若干个页,以页作为磁盘和内存之间交互的基本单位,InnoDB中页的大小一般为16

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

InnoDB是MySQL的数据库引擎之一,现为MySQL的默认存储引擎,为MySQL AB发布binary的标准之一;InnoDB采用双轨制授权,一个是GPL授权,另一个是专有软件授权。InnoDB是事务型数据库的首选引擎,支持事务安全表(ACID);InnoDB支持行级锁,行级锁可以最大程度的支持并发,行级锁是由存储引擎层实现的。

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。

“mysql-connector”是mysql官方提供的驱动器,可以用于连接使用mysql;可利用“pip install mysql-connector”命令进行安装,利用“import mysql.connector”测试是否安装成功。

在mysql中,是否需要commit取决于存储引擎:1、若是不支持事务的存储引擎,如myisam,则不需要使用commit;2、若是支持事务的存储引擎,如innodb,则需要知道事务是否自动提交,因此需要使用commit。

1.Mysql的事务隔离级别这四种隔离级别,当存在多个事务并发冲突的时候,可能会出现脏读,不可重复读,幻读的一些问题,而innoDB在可重复读隔离级别模式下解决了幻读的一个问题,2.什么是幻读幻读是指在同一个事务中,前后两次查询相同范围的时候得到的结果不一致如图,第一个事务里面,我们执行一个范围查询,这个时候满足条件的数据只有一条,而在第二个事务里面,它插入一行数据并且进行了提交,接着第一个事务再去查询的时候,得到的结果比第一次查询的结果多出来一条数据,注意第一个事务的第一次和第二次查询,都在同


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Chinese version
Chinese version, very easy to use

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version
Visual web development tools
