Using the command:
SHOW ENGINES;
You can obtain the following result and verify if you have access to the INNODB
engine available in your database manager
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
And observe in the column that says Support
, how can you verify my
I get the legend Defualt because apart from that if it supports
it comes by default
You can indicate for example at the time of creating your table, the engine with which you should work in this way, as you can see the position at the end of the instruction and with that you should respect that you want to work with INNODB
:
CREATE TABLE usuarios(
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100) UNIQUE NOT NULL,
status_user TINYINT(1) NOT NULL)ENGINE=INNODB;
If I already have my tables created, what can I do?
With the ALTER
command to modify the ENGINE
you have, in this way
ALTER TABLE table_name ENGINE = INNODB;
With the previous command, we will be able to alter the% original ENGINE
and transfer it, for example, from MyISAM
to INNODB