Chauhan
Chauhan

Reputation: 2591

How to increase memory size for phpmyadmin

I am facing some problem when I am trying to import magento database on localhost. It just import 18 table but in actual it contain 383 approx table. It gives error given below

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 2089674 bytes) in /usr/share/phpmyadmin/libraries/import.lib.php on line 253

How this problem will configure. Is there need to change php.ini?

Upvotes: 11

Views: 84496

Answers (7)

Lakhan Sharma
Lakhan Sharma

Reputation: 1

In my case, it works by specifying pcre.jit=0 in the file php.ini.

Upvotes: 0

Wandering Zombie
Wandering Zombie

Reputation: 1121

phpMyAdmin has been blowing memory limits on me lately (and I wasn't even importing/executing large amounts of data) so I've just tried the following in my config.inc.php

$cfg['MemoryLimit'] = '128M';

https://docs.phpmyadmin.net/en/latest/config.html#cfg_MemoryLimit

Upvotes: 12

ayush
ayush

Reputation: 14578

use this :

c:\mysql\bin\> mysql -u username -p password database_name < filename.sql

to import using command line

or in php.ini

memory_limit = 256M

change this to some other larger value. But as Dan said using command line is preferable.

Upvotes: 17

neha
neha

Reputation: 205

Use this :

Edit your php.ini file: Change

memory_limit = 256M

Upvotes: -1

ppiatek
ppiatek

Reputation: 69

I was the same problem with the migration of database.

Try to change configuration of export to build file with queries like this:

INSERT INTO tbl_name VALUES (1,2,3)

When I was creating queries like this one:

INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)

queries were too big to allocate them in memory. When I changed it, there were a lot of small queries so there wasn't problem with memory.

Upvotes: 0

fandasson
fandasson

Reputation: 2403

You can change php.ini as other answers have mentioned. It can be ok on you localhost. But on webserver with more virtualhost you probably don't want to increase memory limit for all hosts (that's what directive in php.ini does).

To increse memory limit only for given virtualhost edit virtualhost settings. For example:

<VirtualHost *:443>
   #your virtualhost settings
   php_value memory_limit 64M #place any number you need
</VirtualHost>

Or, you can place the same php_value into your .htaccess file, but your virtualhost must allow to change this values.

Upvotes: 1

Adrian P.
Adrian P.

Reputation: 5228

Try this http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html I was capable to import a 930 MB database.

Upvotes: 1

Related Questions