MySQL 1163: Client out of memory.

  1. Increase the `readbuffersize` and `readrndbuffer_size` in your MySQL configuration temporarily to see if it alleviates the issue. Adjust these values in your `my.cnf` (Linux) or `my.ini` (Windows) file:


[mysqld]
read
buffersize = 2M
read
rndbuffer_size = 2M
After editing, restart the MySQL service.

  1. Optimize your query to use less memory by reducing the amount of data being processed at one time. For instance, if you’re joining large tables, see if you can filter rows earlier in your query or break your query into smaller parts.



  1. Check the memory usage of your system to ensure MySQL is not running out of memory due to other applications consuming it. Use the `free -m` command (Linux) or open Task Manager (Windows) to view memory usage.



  1. Investigate and set the `tmptablesize` and `maxheaptable_size` if your operations are creating large temporary tables. Increase these values in your `my.cnf`/`my.ini`:


[mysqld]
tmp
tablesize = 256M
max
heaptable_size = 256M
Restart the MySQL service after changes.

  1. Examine your queries for memory leaks especially if using stored procedures or functions. Run `SHOW PROCESSLIST;` to see running queries and `EXPLAIN` your query to understand how MySQL executes it.



  1. Check and clean up your MySQL error log. Sometimes, the log file itself can consume a lot of disk space which might indirectly affect the database performance. Use `SHOW VARIABLES LIKE 'log_error';` to find the log file location, then check its size and manually clear or compress if needed.



7. Increase your server's physical memory (RAM) if possible. This is a more drastic measure if the above adjustments do not help and if you consistently reach the memory limits.

Master

MySQL

in Minutes — Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MySQL

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid