Home > Database > Mysql Tutorial > mysql 下令下执行sql脚本

mysql 下令下执行sql脚本

WBOY
Release: 2016-06-07 16:15:35
Original
1166 people have browsed it

mysql 命令下执行sql脚本 1.首先编写sql脚本,保存为:book.sql, 2.进入MySQL命令行 第一种方式:在未连接数据库的情况下,输入 mysql -h localhost -u root -p 123456 d:\book.sql 回车即可; 第二种方式:在已连接数据库的情况下,此时命令提示符为mysql,

mysql 命令下执行sql脚本
1.首先编写sql脚本,保存为:book.sql,
2.进入MySQL命令行
   第一种方式:在未连接数据库的情况下,输入 mysql -h localhost -u root -p 123456     第二种方式:在已连接数据库的情况下,此时命令提示符为mysql>,输入 source d:\book.sql  或者 \. d:\book.sql 回车即可.
3.以下是使用mysql>\. d:\book.sql 的运行结果
Related labels:
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