Solved - Mysql Out of sort memory, consider increasing server sort buffer size
In this tutorial we will go over the demonstration of Out of sort memory. step by step explain consider increasing server sort buffer size mysql. you'll learn mysql 8 out of sort memory consider increasing server sort buffer size. i would like to show you out of sort memory consider increasing server sort buffer size ubuntu. Let's get started with Out of sort memory.
few days ago i was working on laravel project and when i run one following sql query, it was working on local mysql. but not working on ubuntu server in digitalocean. it tried to run using mysql command and i was able to found exactly error:
Query:
select * from `posts` where exists (select * from `categories` inner join `post_category` on `categories`.`id` = `post_category`.`category_id` where `posts`.`id` = `post_category`.`post_id` and `categories`.`slug` = 'phpexample.html') group by `posts`.`id` order by `posts`.`id` desc
Error Found:
i found following error:
ERROR 1038 (HY001): Out of sort memory, consider increasing server sort buffer size
Solution:
i search on google and find out solution with increasing size of "sort_buffer_size". so let's open my.cnf file update as like bellow:
sudo nano /etc/mysql/my.cnf
update as following:
/etc/mysql/my.cnf
[mysqld]
sort_buffer_size=5M
now you can restart mysql with following command:
sudo service mysql restart
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Import Database in Mysql using Command Line in Ubuntu?
- Node JS Mysql Connection Example
- How to add 1 day to the date column in MySQL?
- MYSQL Query for Data between Two Dates Example
- How to Use MySQL View in Laravel?
- PHP AngularJS MySQL Pagination Example
- PHP MySQL Column Sorting Example Tutorial
- How to Get Query Log in Laravel Eloquent?
- Mysql procedure with pagination in laravel?
- Which MySQL Datatype use for Store an IP Address?
- Mysql Hexadecimal Color Code Store in Binary Datatype Example