How to split sql in MAC OSX?

后端 未结 4 930
广开言路
广开言路 2021-02-04 15:51

Is there any app for mac to split sql files or even script? I have a large files which i have to upload it to hosting that doesn\'t support files over 8 MB.

*I don\'t ha

4条回答
  •  爱一瞬间的悲伤
    2021-02-04 16:24

    You can split into working SQL statements with:

    csplit -s -f db-part db.sql "/^# Dump of table/" "{99}"
    

    Which makes up to 99 files named 'db-part[n]' from db.sql

    You can use "CREATE TABLE" or "INSERT INTO" instead of "# Dump of ..."

    Also: Avoid installing any programs or uploading your data into any online service. You don't know what will be done with your information!

提交回复
热议问题