Skip to content

Instantly share code, notes, and snippets.

@akawajid
Created July 22, 2023 17:36
Show Gist options
  • Save akawajid/a5437e382e3afe57f54098be695f447c to your computer and use it in GitHub Desktop.
Save akawajid/a5437e382e3afe57f54098be695f447c to your computer and use it in GitHub Desktop.
Editing a Large MySQL Database Schema or Dump File in Windows

When dealing with large MySQL database schema or dump files in Windows, it can be challenging to edit them directly due to their size. However, by utilizing Git Bash and a copy command in cmd, we can easily split, edit, and merge these files more conveniently.

If you are already using Git for Windows, you should have Git Bash installed.

  1. Use the split command in Git Bash to split a file: split dbSchemaFile.sql -b 500m

  2. Make the necessary changes to the schema as required.

  3. Merge the edited files back into a single .sql file using copy *.sql updateDBSchema.sql

Credits:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment