tags:

views:

541

answers:

2

When I try to import a large SQL backup using the command:

mysql -u ***** -p***** nxtpp < backup.sql

I get the following error message after the backup is partially executed:

Allowed memory size of 33554432 bytes exhausted

I already know about the memory_limit variable in php.ini, but the problem is that I am not using PHP to import, just the mysql command. How can I fix this? Could the problem have to do with the 128MB of memory the server has?

Edit: It turned out that the phpMyAdmin I was exporting from was producing the error. I could see the error's HTML in the actual dump file. When MySQL executed it, it just printed the error out.

+1  A: 

It looks like there is still php involved somehow. MySQL's error messages are looking different.

Are you maybe trying to execute this command with the exec() or system() statement in php? Then the memory_limit still applies.

Peter Smit
A: 

Assuming like Peter Smit said that this isn't being run inside of a PHP script, try increasing your MySQL setting for key_buffer to something larger.

Warning: This is a key performance tuning setting, so change it carefully. Higher values will let MySQL consume much more of your machine's memory.

As an aside, this should be moved to http://serverfault.com when it goes live.

jpe

Justin