Home > Database > Mysql Tutorial > MySQL批量执行sql语句_MySQL

MySQL批量执行sql语句_MySQL

WBOY
Release: 2016-06-01 13:34:24
Original
1441 people have browsed it

bitsCN.com

MySQL批量执行sql语句

 

首先建立一个bat文件,然后用记事本打开bat文件并编辑如下:

 

rem MySQL_HOME 本地MySQL的安装路径

rem HOST mysql 服务器的ip地址,可以是本地,也可以是远程

rem PORT mysql 服务器的端口,缺省为3306

 

rem USER PASSWORD 具有操作数据库权限的用户名和密码,如root

rem DEFAULT-CHARACTER-SET 数据库所用的字符集

rem DATABASE 要连接的数据名,这里用的qc1

 

rem test.sql 要执行的脚本文件,这里为mysql.sql

rem mysql 后面的应该放在一行。

SET MySQL_HOME=D:/DATABASE/MySQL/MySQL SERVER 5.1

SET PATH=%MySQL_HOME%/BIN;%PATH%

 

mysql --host=localhost --port=3306 --user=root --password=sa --default-CHARACTER-SET=utf8 qc1

pause

 

保存后,双击bat文件运行即可

 

bitsCN.com
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template