I am working in WindowsXP . My need is to create a database and restore that
database with data.sql file using batch script . This is needed while user configures the project . I tried the following method but it doesn't work for me.
// createdb.bat
// Password is empty
@echo off
mysql -u root -p < mysql.sql
//mysql.sql
CREATE DATABASE newdb ;
And i have both files in my Desktop . Any help please ?
mysql -u root -pPASSWORD < mysql.sql. Or if the script is failing becausenewdbalready exists, try addingdrop database newdb;before thecreate databaseline.if not exist mysql.sql echo Cant find mysql.sql file!before the line where it is used. And add a line of justpauseas the last line, so you get a chance to see what's happened before the window vanishes.