Get the App
SLTechnology News&Howtos  ›  Database  › 

How to modify the mysql database storage engine

Shulou Source: shulou.com Published: 2022-06-01 19:08:32 09月13日 Update

Let's talk about how to modify the mysql database storage engine. The secret of the text is to be close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading how to modify this article by the mysql database storage engine.

We generally have two ways to modify the storage engine of the mysql database.

Change method 1: modify the configuration file my.cnf

Open my.cnf, add it as default-storage-engine=InnoDB at the end of [mysqld], and restart the database service

The default engine of the database is changed to InnoDB

Before the change

After the change

Change mode 2: specify or modify the table when you create the table

Mysql code

-- specify when creating the table

Create table test (

Id int primary key

Name varchar (10)

) type=InnoDB

-- modify the table after it has been built

Alter table test type = InnoDB

-- View the modification result (test is the database name of the table)

Show table status from test

Show table status from test where name='test'

Use the command to view the storage engine

Mysql > show variables like'% storage_engine%'; you need to see what engine is used in a table (in the display results, the parameter engine indicates the current storage engine used for the table):

Mysql > show create table table name

Is there anything you don't understand about how to modify the relevant content of the above mysql database storage engine? Or if you want to know more about it, you can continue to follow our industry information section.

Tags: Engine data database storage method time result following subject code content parameter name command place secret location file text way Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Xiaomi Huawei MySQL Linux