PDA

View Full Version : MySQL error



trawets
03-29-2008, 08:41 AM
Hi :D

I have been trying to install a mysql script into a database through phpMyAdmin
all seem to go well for about 2 Min's or more and then I get this error

Fatal error: Allowed memory size of 134217728 bytes exhausted
(tried to allocate 113483456 bytes) in /usr/local/cpanel/base/
3rdparty/phpMyAdmin/libraries/unzip.lib.php on line 325
could anyone advise on what this means,

I tried live chat and they told me to post a ticket well that takes forever so I thought Id ask you guys
Thanks in anticipation

TheWebHostingHero
03-29-2008, 09:44 AM
It's because your script (phpMyAdmin in this case) requires more memory than allowed.

This limit is set in php.ini therefore it can only be changed by the system administrator.

Another option would be to use the ini_set() function to change the memory limit.

TheWebHostingHero
03-29-2008, 09:45 AM
Forgot to say that changing the memory limit using ini_set may get your account suspended if you're using too much resources.

trawets
03-29-2008, 11:55 AM
Hi
Thanks for the reply,

do you mean by
This limit is set in php.ini therefore it can only be changed by the system administrator

the lines in php.ini
memory_limit = 32M ; Maximum amount of memory a script may consume (10MB)
(I changed this value to 42M and the same happened,)
or do you mean the system admin will have to change this because changing locally (on my php.ini) doesn't have any effect then I will have to contact BH about this.

any tips on how to use the ini_set() function

trawets
03-29-2008, 11:59 AM
if I used this in my php.ini would it work


string ini_set ( string $memory_limit , string $42M )

TheWebHostingHero
03-29-2008, 02:06 PM
First of all, try using phpinfo() to see if your change to php.ini has any effect:

<?php phpinfo(); ?>

Second, it seems that it's the unzipping process that's sucking resources so I guess you're trying to import a compressed SQL script. Here's my suggestion:

1. Upload the compressed SQL file to your web server using FTP.
2. Connect to the server using SSH (using a client like PUTTY)
3. Extract the content form the archive. I don't how it's compressed but if it's a zip archive, use:


unzip [archive].zip

..and if it's a gzipped tarball, use:


tar xvzf [archive].tar.gz

4. Use mysql to import the SQL script:


mysql -u username -p database_name < file.sql

This way PHP has nothing to do with it and you won't run into its memory limit.

felgall
03-29-2008, 02:17 PM
You can also decompress the zip file via the File Manager if you don't have SSH access

trawets
03-29-2008, 04:26 PM
I am trying to migrate a joomla db here, fortunately I have the dump on the server uncompressed, do I need to import this through SSH command line ( I do have access but not familiar with commands) or can this be done though phpMyAdmin

felgall
03-29-2008, 04:31 PM
phpMyAdmin has a 2Mb limit on import file sizes so if you are going to import the data that way you need to make sure that each file you import is smaller than that.