1, the establishment of a database file: mysqlCreatDB.sql
create database mydb
2, provides a user with permissions file: grantUser.sql
grant select, insert, update, delete, index, execute on mydb * to “identified by” 123456 “;
3, restore the database files: Mydb.sql
4, the batch file: mysqlConfig.bat
@ ECHO OFF
@ Set input1 =
@ Set / p input1 = Please enter the password of the MySQL database root user:
: Begin
mysql-uroot-p% input1% <mysqlCreatDB.sql
mysql-uroot-p% input1% <grantUser.sql
mysql-uroot-p% input1% usbhostdb <usbhostdb.sql
@ Echo MySQL database configuration is complete
pause
: End
Note: The files need to be put mysql / bin under
