I was just wondering if we can execute a binary file in batch mode. I know that a text file can be executed in batch mode using mysql < batch-file.
One possible motivation for such a feature can be if you are creating a sql file from a program then you might want to do read/write in binary mode as it is fast. Does there exist any such way in mysql, I am just curious!!
You might want to try using the
--hex-bloboption ofmysqldumpto create dump files that are purely text. Typically you’ll do this:Later you’ll restore:
In both cases
...represents the command-line options required to connect to your database.This is not the most efficient way to load in large databases, but it works well enough in practice.