Search code examples
mysqlwindows-7unicodecommand-linerun-script

How to execute large MySQL data-insert script file using command line in Windows 7?


I'm new to MySQL. I am interested how to do this via command line; I've tried but I get NO logging in the console output and the character set is not utf-8.


Solution

  • Since your SQL script doesn't contain any character set configuration directives, mysql just runs in its default character set Latin1. To change the default character set, start mysql like this:

    mysql -e "source /path-to-backup/backup-file.sql" db_name --default-character-set=UTF8