【login.bat】
mysql -h localhost -u root -p123456 < mysql.sql >mysql.out
【mysql.sql】
#select "display all databases";
#select "============================";
show databases;
select " ";
#select "select database";
#select "============================";
use testdb;
show tables;
select " ";
#select "============================";
#check the table value
select * from pet;
select " ";
#select "============================";
#select dog's owner
select * from pet where species = "dog";
【mysql.out】
Database
information_schema
mysql
test
testdb
Tables_in_testdb
event
pet
name owner species sex birth death
Claws Gwen cat m 1994-03-17 NULL
Buffy Harold dog f 1989-05-13 NULL
Fang Benny dog m 1990-08-27 NULL
Bowser Diane dog m 1979-08-31 1995-07-29
Chirpy Gwen bird f 1998-09-11 NULL
Whistler Gwen bird NULL 1989-08-31 1997-12-09
Slim Benny snake m 1996-04-29 NULL
Pufball Diane hamster f 1999-03-30 NULL
name owner species sex birth death
Buffy Harold dog f 1989-05-13 NULL
Fang Benny dog m 1990-08-27 NULL
Bowser Diane dog m 1979-08-31 1995-07-29