Jump to content

Database: I have tables of type InnoDB and MyISAM...


MEVi

Recommended Posts

DYNAMIC row format, not working with my host

#!/bin/bash

DATABASE=XXX

ROW_FORMAT=DYNAMIC
#ROW_FORMAT=COMPRESSED

TABLES=$(echo SHOW TABLES | mysql -s $DATABASE)

for TABLE in $TABLES ; do
    echo "ALTER TABLE $TABLE ROW_FORMAT=$ROW_FORMAT;"
    echo "ALTER TABLE $TABLE ROW_FORMAT=$ROW_FORMAT" | mysql $DATABASE
done

 

Link to comment
Share on other sites

@Paul E.,

Quote

How to convert MyISAM to InnoDB?

Here is how we convert to InnoDB using phpMyAdmin and MySQL CLI. First, let’s see how we do it using phpMyAdmin.

  • First, we login to phpMyAdmin.
  • Then, check the type column and see the storage engines.
  • Later, click on the MyISAM table and click the Operations tab and change the storage engine.

Alternatively, we run the below command to change the storage engine of a particular table to InnoDB.


ALTER TABLE table_name ENGINE=InnoDB;
Link to comment
Share on other sites

Bob is giving some poor advice. Don't perform schema changing SQL operations via phpMyAdmin. phpMyAdmin can be a useful tool to do some basic row level inquiries/modifications if needed and basic exploration. You should get into the habit of using a proper client on the database server itself for significant write and change commands. Changing the underlying engine of a table is a significant change. Connecting via terminal and using the mysql command would be a far better approach.

Command line documentation:
https://dev.mysql.com/doc/refman/8.0/en/mysql.html

If your host doesn't give you the option to make the row format dynamic (you may be on an older version of MySQL, and/or your database may be using the original Antelope file format and not Barracuda, the newer InnoDB file format required for dynamic row format), and you're not having issues, then you should be okay for now. It's a recommendation but not a requirement.

The steps required to do all this are going to require reading up on the documentation and better understanding your specific hosting environment. Take a look at what version of MySQL you're running, the schema properties of your database, and how the database engine is configured.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...