[Solved] – Mysql Out of sort memory, consider increasing server sort buffer size

In this blog post i will give this title of the error and give the Mysql Out of sort memory, consider increasing server sort buffer size.

mysql.conf TDS_SORT_BUFFER_BITS = 4096 mysql.conf /var/lib/mysql/mysql.conf -u root -p tcp -d 1.2.3.4:9300 -c ‘a fast md5 authentication’ 1 2 mysql . conf TDS_SORT_BUFFER_BITS = 4096 mysql . conf / var / lib / mysql / mysql . conf – u root – p tcp – d 1.2.3.4 : 99300 – c ‘a fast md5 authentication’
And then increasing the server memory amount to 4096 with a daily increment of 1 Mysql Out Of Sort Memory, Consider Increasing Server Sort Buffer Size.
1 2 mysql . conf TDS_SORT_BUFFER_BITS = 4096 -u root -p tcp -d 1.2.3.4:9300 -c ‘a fast md5 authentication’ 1 2 mysql . conf TDS_SORT_BUFFER_BITS = 4096 – u root – p tcp – d 1.2.3.4 :

Mysql Out Of Sort Memory, Consider Increasing Server Sort Buffer Size

Found This error:

Error "1038 Out of sort memory, consider increasing server sort buffer size

The query of Mysql Out Of Sort Memory, Consider Increasing Server Sort Buffer Size solution:

$queryBuilder = $this
    ->createQueryBuilder('object')
    ->leftJoin('table.objectCategory', 'c')
    ->leftJoin('table.recipients', 'r')
    ->leftJoin('table.tags', 't')
    ->leftJoin('table.votes', 'v')
    ->leftJoin('table.comments', 'comments')
    ->leftJoin('v.user', 'vuser')
    ->groupBy('table, c, t, v, u')
    ->where('table.isVisible = :isVisible')
    ->orderBy('table.createdAt', 'DESC')
    ->setParameter('isVisible', true)
    ->orderBy('vote_value', 'DESC')
    ;

Just run mysql query

SET GLOBAL sort_buffer_size = 500000000 // It'll reset after server restart

To set permanent

Edit below file and add

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

sort_buffer_size = 500000000 

sudo service mysql restart

You need to increase the buffer size of mysql in the /etc/mysql/my.cnf, something like:

[mysqld]
sort_buffer_size=5M

1 thought on “[Solved] – Mysql Out of sort memory, consider increasing server sort buffer size”

Leave a Comment