
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How to create a MySQL table with MyISAM engine table?
To create a MySQL table with MyISAM engine, we can use ENGINE command. Let us first create a table using CREATE command.
mysql> create table StudentRecordWithMyISAM -> ( -> Id int, -> StudentName varchar(100), -> StudentAge int -> )ENGINE=MyISAM; Query OK, 0 rows affected (0.26 sec)
Above, we have set the ENGINE as “MyISAM”.
To check how many columns are present in the table, use DESC command.
mysql> DESC StudentRecordWithMyISAM;
The following is the output.
+-------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+-------+ | Id | int(11) | YES | | NULL | | | StudentName | varchar(100) | YES | | NULL | | | StudentAge | int(11) | YES | | NULL | | +-------------+--------------+------+-----+---------+-------+ 3 rows in set (0.00 sec)
To check if the table is presented with MyISAM or not.
mysql> SHOW TABLE STATUS FROM business LIKE 'StudentRecordWithMyISAM';
The following is that output that clearly shows the ENGINE is MyISAM.
+-------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ | studentrecordwithmyisam | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | 1 | 2018-10-22 15:47:01 | 2018-10-22 15:47:02 | NULL | utf8mb4_unicode_ci | NULL | | | +-------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ 1 row in set (0.14 sec)
To check if the MyISAM table exists or not.
mysql> SELECT TABLE_NAME, -> ENGINE -> FROM information_schema.TABLES -> WHERE TABLE_SCHEMA = 'business' and ENGINE = 'MyISAM';
The following is the output.
+-------------------------+--------+ | TABLE_NAME | ENGINE | +-------------------------+--------+ | studentrecordwithmyisam | MyISAM | +-------------------------+--------+ 1 row in set (0.00 sec)
- Related Articles
- How to create a MySQL table with InnoDB engine table?
- MySQL - changing table engine from innoDB to MyISAM?
- How do I know if a MySQL table is using myISAM or InnoDB Engine?
- How to change Table Engine in MySQL?
- How to update MySQL table storage engine
- How to display the Engine of a MySQL table?
- Converting table from MyISAM to INNODB in MySQL?
- How to create a MySQL table with indexes?
- How to convert MyISAM to InnoDB storage engine in MySQL?
- How to alter the database engine of a MySQL database table?
- Create a temporary table similar to a regular table with MySQL LIKE
- Create MySQL query to create a table from an existing table?
- How can I change the storage engine of a MySQL table?
- How to create conditions in a MySQL table with multiple columns?
- How to create a temporary MySQL table in a SELECT statement without a separate CREATE TABLE?

Advertisements