While restoring a dump file having 4 GB of size Mysql gives Out of memory around after 10 minutes success full restore. Error details are given below.
Configuration: Mysql version : Mysql 5.0.41 32 bit max_allowed_packet = 300M
mysql>source my_dump.sql
Error:
Query OK, 2310 rows affected (0.69 sec)
Records: 2310 Duplicates: 0 Warnings: 0
mysql: Out of memory (Needed 1564047040 bytes)
mysql: Out of memory (Needed 1564047048 bytes)
Solutions will be appreciable.
This sounds alot like your RAM ran full during the process of restoring the dump. Have you checked with free -m if your RAM and SWAP run full?
If this is the case, one solution could be to either manually split the dump (so each table has it's own file and you can restore them step by step) or you could increase the SWAP space of your machine.
You can temporary increase your swap space by creating a swap file. That won;t require reboot or disk re-partitioning.
Here's how-to