createDB.bat文件内容:

@echo off
cd C:/Program Files/cl_ZWL_App/<a href="http://lib.csdn.net/base/14" class='replace_word' title="MySQL知识库" target='_blank' style='color:#df3434; font-weight:bold;'>MySQL</a>-5.1.6-alpha-win32/bin
set errorlevel=0
set database=wlsddb
set user=root
set password=co899
cd %path_bin_mysql%
mysql.exe -u%user% -p%password% %database%<createTB.sql
pause
echo end backup
@echo ----谢谢配合!
exit

 

其中createTB.sql和createDB.bat文件放在同一目录下,为建表用。

 

createTB.sql

 

use db2;
DROP TABLE IF EXISTS `tb2`;
CREATE TABLE `tb2` (
`bi_id` int(11) NOT NULL auto_increment,
`bi_file_name` text,
`bi_create_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`bi_id`),
UNIQUE KEY `bi_id` (`bi_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
commit;