Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make innodb as default engine

Tags:

mysql

innodb

I am trying to make Innodb as my default engine and I changed this in the my.cnf file.

I set default-storage-engine=InnoDB in my.cnf file and restarted mysql but still it's not taking it.

Even after restarting the server, it's still showing default engine as MyISAM.

show engines

+------------+---------+-
| Engine | Support |
+------------+---------+-
| InnoDB | YES |
| MRG_MYISAM | YES |
| BLACKHOLE | YES |
| CSV | YES |
| MEMORY | YES |
| FEDERATED | NO |
| ARCHIVE | YES |
| MyISAM | DEFAULT |
+------------+---------+-

How can I change it to InnoDB ?

like image 459
user476554 Avatar asked Nov 16 '10 21:11

user476554


People also ask

How do I change my default engine to InnoDB in MySQL?

The default engine is InnoDB in MySQL 8.0. You can specify the default engine by using the --default-storage-engine server startup option, or by setting the default-storage-engine option in the my. cnf configuration file.

What is the default engine in MySQL?

InnoDB is the default and most general-purpose storage engine, and Oracle recommends using it for tables except for specialized use cases. (The CREATE TABLE statement in MySQL 8.0 creates InnoDB tables by default.)


1 Answers

Make sure you add this line in the proper section of the my.cnf file. It needs to be in the [mysqld]section:

default-storage-engine=InnoDB

Also, comment out any other line in my.cnf that may be setting it to MyISAM.

like image 167
Ike Walker Avatar answered Oct 05 '22 00:10

Ike Walker