
- 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
MySQL system variable table_type doesn't work?
The variable table_type doesn’t work since this variable is deprecated as of MySQL 5.5.3. Use default_storage_engine instead. Following is the syntax −
SET default_storage_engine = yourTableEngine;
The table engine name may be InnoDB or MyISAM. Here, we will set engine type to MyISAM −
mysql> SET default_storage_engine=MyISAM; Query OK, 0 rows affected (0.00 sec)
Let us create a table.
mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY ); Query OK, 0 rows affected (0.40 sec)
Now check the engine type of above table −
mysql> SHOW TABLE STATUS WHERE Name = 'DemoTable';
This will produce the following output −
+--------------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | 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 | +--------------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ | DemoTable | MyISAM | 10 | Fixed | 0 | 0 | 0 | 1970324836974591 | 1024 | 0 | 1 | 2019-05-01 22:15:03 | 2019-05-01 22:15:03 | NULL | utf8_unicode_ci | NULL | | | +--------------+--------+---------+------------+------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+ 1 row in set (0.34 sec)
Look at the above sample output, the engine type is MyISAM.
NOTE − In MySQL version 8.0.12, the default storage is InnoDB. Here we have changed the storage engine to MyISAM for current session only.
- Related Articles
- How to work with array variable in MySQL?\n
- How does JavaScript Variable Scope work?
- How does System Boot work?
- How does variable scope work in python?
- How does variable scopes work in Python Modules?
- MySQL temporary variable assignment?
- MySQL CREATE USER with a variable?
- How does MySQL CASE work?
- How to declare a variable in MySQL?
- MySQL how to declare a datetime variable?
- Using DECLARE to create variable in MySQL?
- Perform MySQL SELECT INTO user-defined variable
- Set MySQL select in a custom variable
- How does MySQL IF() function work?
- How Does an Order Management System Work with a CRM?

Advertisements