The Fatal error: Allowed memory size error indicates that there is not enough time and limits on the server to complete the process that you started.
Here is the actual block for inserting into .htaccess, with which the limits from php.ini will be increased, after that you can import a large dump into the database through the PhpMyAdmin, or upload a large file via the web interface, and the scripts will not die during execution process:
php_value memory_limit 256M php_value upload_max_filesize 256M php_value post_max_size 256M php_value max_execution_time 300 php_value max_input_time 300