Export Large Database zip

xargs

Registered
Jan 5, 2014
3
0
1
cPanel Access Level
Root Administrator
Hello,

I have a VPS with cPanel 11.48, Centos 5.8 .

I am trying to export a large database with phpmyadmin in .zip but I am getting always a memory error.

I tried to increase memory_limit to 1024M in /usr/local/cpanel/3rdparty/php/54/etc/php.ini and /usr/local/cpanel/3rdparty/php/54/etc/phpmyadmin/php.ini with no luck:

/usr/local/cpanel/logs/error_log:

Code:
PHP Fatal error:  Out of memory (allocated 523239424) (tried to allocate 521637680 bytes) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/zip.lib.php on line 140
PHP Fatal error:  Out of memory (allocated 523239424) (tried to allocate 521637680 bytes) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/zip.lib.php on line 140
PHP Fatal error:  Out of memory (allocated 523239424) (tried to allocate 521637680 bytes) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/zip.lib.php on line 140

strace:

mmap(NULL, 521670656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x211f4000)  = 0x20b4000
mmap(NULL, 521801728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f06b2e6d000
munmap(0x7f06b2e6d000, 18427904)  = 0
munmap(0x7f06b8000000, 48680960)  = 0
mprotect(0x7f06b4000000, 135168, PROT_READ|PROT_WRITE) = 0
mmap(NULL, 521670656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
open("/usr/local/cpanel/logs/error_log", O_WRONLY|O_CREAT|O_APPEND, 0644) = -1 EACCES (Permission denied)
write(2, "PHP Fatal error:  Out of memory "..., 170) = 170
chdir("/usr/local/cpanel/base")  = 0
write(6, "\1\0\0\0\1", 5)  = 5
shutdown(6, 2 /* send and receive */)  = 0
close(6)  = 0
munmap(0x7f071f165000, 1003520)  = 0
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0
pwrite(3, " PMA_token |s:32:\"79f4ae5da4f9b7"..., 18189, 0) = 18189
close(3)  = 0
write(1, "Status: 500 Internal Server Erro"..., 35) = 35
write(1, "X-Powered-By: PHP/5.4.23", 24) = 24
write(1, "\r\n", 2)  = 2
write(1, "Expires: Thu, 02 Jul 2015 10:20:"..., 40) = 40
write(1, "\r\n", 2)  = 2
write(1, "Cache-Control: no-store, no-cach"..., 89) = 89
write(1, "\r\n", 2)  = 2
write(1, "Pragma: no-cache", 16)  = 16
write(1, "\r\n", 2)  = 2
write(1, "Last-Modified: Thu, 02 Jul 2015 "..., 46) = 46
write(1, "\r\n", 2)  = 2
write(1, "Content-Description: File Transf"..., 34) = 34
write(1, "\r\n", 2)  = 2
write(1, "Content-Disposition: attachment;"..., 62) = 62
write(1, "\r\n", 2)  = 2
write(1, "Content-Type: application/zip", 29) = 29
write(1, "\r\n", 2)  = 2
write(1, "Content-Transfer-Encoding: binar"..., 33) = 33
write(1, "\r\n", 2)  = 2
write(1, "\r\n", 2)  = 2
close(4)  = 0
munmap(0x7f071f67e000, 266240)  = 0
munmap(0x7f071f63d000, 266240)  = 0
munmap(0x7f071f5bb000, 266240)  = 0
munmap(0x7f071f57a000, 266240)  = 0
munmap(0x7f071f539000, 266240)  = 0
munmap(0x7f071f5fc000, 266240)  = 0
munmap(0x7f0722ddc000, 266240)  = 0
munmap(0x7f0722e42000, 266240)  = 0
munmap(0x7f0722f05000, 266240)  = 0
munmap(0x7f0722ec4000, 266240)  = 0
munmap(0x7f0722c97000, 266240)  = 0
rt_sigaction(SIGPIPE, {0x1, [PIPE], SA_RESTORER|SA_RESTART, 0x3b57630030}, {0x1, [PIPE], SA_RESTORER|SA_RESTART, 0x3b57630030}, 8) = 0
write(5, "\1\0\0\0\1", 5)  = 5
shutdown(5, 2 /* send and receive */)  = 0
close(5)  = 0
......
I dont have any problem with gzip or bzip but a customer wants to do it in zip. Any idea?

Regards.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Hello :)

I suggest using the command line if it's a large database. EX:

Code:
mysqldump database_name >  database.sql
zip database.zip database.sql
Thank you.