简体   繁体   中英

MySQL shared hosting: db is MyISAM, although all created tables are InnoDB. Can I switch? Should I?

My question is about the Type of db that is on a shared hosting Linux server. phpMyAdmin shows that db has MyISAM Type. I don't think I can change it. I mean I don't know. All tables in that db have InnoDB type. Does it make sense to change db type to InnoDB? Should I? (I don't know if I can choose a db type on a shared hosting server). Of course I can contact a customer support and ask them to switch if they can, but I don't know if it makes any sense and has any pros.

Should I take care of it?

Thank you 在此输入图像描述 . Added: The image above is a screenshot from phpMyAdmin.

You might misunderstanding, database does not have a storage engine .
The storage engine is meant for table.
You can only switch the storage engine for tables.

However, myisam does not support transactional,
and innodb (mysql version <5.6) does not support full-text search.

Without knowing which tables in which database,
my guess is you should not change the storage engine.

Example :-

http://demo.phpmyadmin.net/STABLE/index.php?lang=en&collation_connection=utf8_general_ci

The bottom row showing in phpmyadmin is the equivalent of :-

show create database YOUR_DATABASE;

when you create new table without specify a storage engine,
the default storage engine type on the database will apply to it.

for mysql version 5.5, default storage engine is change to innodb.

there is no direct way to change database default storage engine after you have create a database

the workaround is create a new database with you desired default storage engine,
then rename all the tables currently reside in the existing database to this database.

This is the default storage engine of the server. If you do not specify a storage engine when creating a table then the server picks MyISAM as the default

For example on my server InnoDB is the default.

mysql> show engines\G
*************************** 1. row ***************************
      Engine: InnoDB
     Support: DEFAULT
     Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
          XA: YES
  Savepoints: YES

Also in answer to your second question. Yes you can change the storage engine. You can do this with the ALTER TABLE command.

ALTER TABLE mytable ENGINE=MYISAM;

I suggest not to change storage engines unless you have a specific need for a feature in an engine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM