Splitting a SQL insert from PHPmyAdmin to Adminer
I am trying to move my database to another server.
My Adminer has a 2MB SQL max dump (upload) limit.
I currently have one table that is开发者_如何学Go about 10MB big.I was wondering what approaches I can take to split this 10MB table (or modify the dump file) in order to import it via Adminer.
There are following options:
- Upload the file by FTP as
adminer.sql
(oradminer.sql.gz
) and then run it from server. - Gzip or Bzip2 the file - maybe it can squeeze in 2 MB.
- Increase the PHP limit -
upload_max_filesize
andpost_max_size
. - Export the table by parts - limit the result set and export it from select.
Try this : Adminer: to increase limit for import
/etc/php/5.6/apache2$ *sudo vim php.ini*
upload_max_filesize = 200M // 2M originally
sudo service apache2 restart
If your database.sql.gz file is on server or anywhere else, you can import it using the following method.
$ zcat import_file.sql.gz | mysql -uroot -p database_name
It will ask you for your SQL password, just entered it, and then you're done. If database_name flash the error then just create manually database_name in your "adminer" then import. It will work 100% sure.
精彩评论