简体   繁体   中英

Mysql large database import

I am trying to import a database of 55 MB to mysql on localhost and DB in XML format and I am getting a out of memory error.

Fatal error: Out of memory (allocated 549453824) (tried to allocate 485169255 bytes) in E:\XAAMP\phpMyAdmin\libraries\Error_Handler.class.php on line 305

Before this I have change the php.ini file and made

  upload_max_filesize = 256M
  post_max_size = 128M

You also need to increase the allowed memory limit in your php.ini - eg:

memory_limit = 256M

Or directly in the script with ini_set()

ini_set('memory_limit','256M');

Still a better solution would be to import it using:

mysql -u your_username -p db_name < paht_to_sql_file.sql

Try this:

`SET GLOBAL max_allowed_packet=1073741824`;

在此处输入图片说明

It can be run at your query in your working database itself.

it is somehow help a lot mostly if we are working a huge records from mysql database.

Hope it Helps..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM