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

How to modify the mysql database storage engine

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

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.

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