MySQL storage engine (MyISAM to INNODB)

1

I have a hosting on GoDaddy, I was testing, perform some tests with (begin, rollback, commit) transactions, which had no effect. I was investigating and I realized that "MyISAM" does not allow transactions, so I assumed that the storage engine that I have at the moment is that. I was also consulting and looking at the GoDaddy CPanel and I did not find any place where I could see the storage engine, let alone modify it. Someone who knows how to make this change?

It would be very helpful. Thank you very much.

    
asked by Juan Camilo 09.06.2018 в 06:14
source

3 answers

0

What you can try is to change the storage engine with a SQL statement you have to do it for each table you require:

ALTER TABLE table_name ENGINE=InnoDB;

to set it as default if your plan is shared, the only option is to check it with your provider to see if they can change it.

    
answered by 09.06.2018 в 06:27
0

If you have access to the mysql console, execute:

 show engines;

Press enter and you will see the engine that uses your default database and you can also see if InnoDB is available or not.

Unfortunately I do not know the GoDaddy servers, but it would be very interesting to know the version of mysql you are using and to know if you have root access to the system bash (in case you have a Linux)

    
answered by 09.06.2018 в 13:02
0

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

    
answered by 09.06.2018 в 13:25