I have this very weird project that my boss gave me. Given my cws.sql file inside "C:/", i need to create a batch file wherein it will automatically create database cws; and use cws; in MySQL Server.
Hope Someone can help me. :'(

Create cws.sql with following Lines :

drop database if exists cws;
create database cws;
use cws;

Hope it helps !

Wow, tnx~
Because of this i came to a working script:

DROP DATABASE if EXISTS cws;
CREATE DATABASE cws;
USE cws;
SOURCE C:/cwsbackup.sql

You are most welcome. Please Close this post as resolved :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.