MySQL executes SQL statements in batches. First, create a bat file, use NotePad to open the bat file, and edit the file as follows: rem MySQL_HOME local MySQL installation path rem HOST mysql Server IP address, which can be local, it can also be the PORT of the remote rem PORT mysql server. The default value is 3306 rem user password, for example, the character set rem DATABASE used by the rootrem DEFAULT-CHARACTER-set database is the data name to be connected to. The qc1 rem test is used here. the script file to be executed by SQL, Which is mysql. sqlrem mysql should be followed by a row. SET MySQL_HOME = D: \ DATABASE \ MySQL SERVER 5.1 set path = % MySQL_HOME % \ BIN; % PATH % mysql -- host = localhost -- port = 3306 -- user = root -- password = sa -- default-CHARACTER-SET = utf8 qc1 <mysql. after sqlpause is saved, double-click the bat file to run it.