Home > Database > Mysql Tutorial > body text

mysql执行外部sql_MySQL

WBOY
Release: 2016-06-01 13:45:54
Original
1101 people have browsed it

bitsCN.com

mysql执行外部sql
 
如果有一个外部sql文件名叫"mydb.sql";是要创建一个表,假定数据库为"mydb";
1.mysql 未登录:
Java代码 
mysql -uroot -p1234 //绝对路径,单引号可以无 
mysql -uroot -p1234  mydb //直接进入mydb,结果一样,如果sql文件没有use 声明,可以 
 
2.mysql 已登录:
Java代码 
source /root/桌面/abc.sql; 
//source 后面跟上绝对路径,可以 

bitsCN.com
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