10

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 ?

Wouter Dorgelo
  • 11,770
  • 11
  • 62
  • 80
user476554
  • 667
  • 5
  • 8
  • 12
  • Can you please try default-storage-engine=innobase? – AndreKR Nov 16 '10 at 22:07
  • default-storage-engine=innobase - Nope it did not work.. – user476554 Nov 16 '10 at 22:30
  • @user476554 - check your full command that you used to connect to mysql, Or `show variables like '%engine%';` – ajreal Nov 16 '10 at 22:33
  • mysql> show variables like "%engine%" -> ; +---------------------------+--------+ | Variable_name | Value | +---------------------------+--------+ | engine_condition_pushdown | ON | | storage_engine | MyISAM | +---------------------------+--------+ 2 rows in set (0.00 sec) – user476554 Nov 16 '10 at 22:40

1 Answers1

22

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.

Ike Walker
  • 64,401
  • 14
  • 110
  • 109
  • This is my my.cnf file datadir=/var/lib/mysql user=mysql table_cache = 2048 innodb_buffer_pool_size = 2G innodb_file_per_table innodb_log_buffer_size=8M innodb_log_file_size=128M innodb_additional_mem_pool_size=4M innodb_table_locks = 0 default-storage-engine=InnoDB join_buffer_size=2M query_cache_size=512M sort_buffer_size=8M read_buffer_size=8M read_rnd_buffer_size=4M key_buffer = 512M key_buffer_size=256M max_allowed_packet=16M max_connections=250 long_query_time=5 innodb_autoinc_lock_mode=2 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid – user476554 Nov 16 '10 at 22:34
  • Thank u...I for got to put [mysqld] to start mysqld section in my.cnf file...then I restarted and it worked – user476554 Nov 16 '10 at 22:53
  • Also modify the [wampmysqld64] section – Ashwin Balani Jun 21 '21 at 19:12