
- 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
Change max_heap_table_size value in MySQL?
The max_heap_table_size is a system variable that has both read/write property.
Initially, max_heap_table_size has size 16 MB. First, check the value of max_heap_table_size, which is in bytes.
The query is as follows −
mysql> select @@max_heap_table_size;
The following is the output −
+-----------------------+ | @@max_heap_table_size | +-----------------------+ | 16777216 | +-----------------------+ 1 row in set (0.00 sec)
Now let us how the value 16777216 byte = 16 MB −
1 MB = 1024KB 1KB = 1024 Bytes 1MB = 1024*1024 bytes. To convert 16777216 byte to MB you need to divide 1024*1024. =16777216/(1024*1024) =16777216/1048576 =16 MB
Now you can change the max_heap_table_size using SET command. The syntax is as follows −
SET @@@@max_heap_table_size=yourNumberOfBytes.
Let us change max_heap_table_size value. The number of bytes is 33554432, which is equal to 32 MB.
The query is as follows −
mysql> set @@max_heap_table_size=33554432; Query OK, 0 rows affected (0.00 sec)
Now check the value of @@max_heap_table_size. The query is as follows −
mysql> select @@max_heap_table_size;
The following is the output −
+-----------------------+ | @@max_heap_table_size | +-----------------------+ | 33554432 | +-----------------------+ 1 row in set (0.00 sec)
Let us see how whether it is equal to 32MB or not. The formulae used here is discussed above −
mysql> select @@max_heap_table_size/1048576 as MB;
The following is the output −
+---------+ | MB | +---------+ | 32.0000 | +---------+ 1 row in set (0.00 sec)
- Related Articles
- Change tinyint default value to 1 in MySQL?
- Change value from 1 to Y in MySQL Select Statement?
- Change value from 1 to Y in MySQL Select Statement using CASE?
- Change value of decimal(19, 2) when inserting into the database in MySQL?
- How can I change the value of an instance of a row in MySQL table?
- Change input type value attribute in jQuery
- jQuery .val change doesn't change input value?
- How to change Table Engine in MySQL?
- How to change max_allowed_packet size in MySQL?
- Change the Auto Increment counter in MySQL?
- Purpose of using CHANGE command in MySQL?
- How do I avoid the variable value in a MySQL stored procedure to change when records are updated?
- How to change MySQL timezone?
- Updating boolean value in MySQL?
- Change One Cell's Data in MySQL?

Advertisements