MySQL中导入sql脚本
例如:我的用户名是root 密码是123 sql脚本存在C盘 名字为test.sql 数据库为test
有两种方法可以执行脚本
1:打开CMD输入以下命令(不需要转换目录)
>mysql -u root -p123
进入MySQL
mysql>use test;
mysql> source c:/test.sql
ok执行完了,你可以用show tables;查看有哪写表(记得语句后有个分号)
还可以用desc tableName;查看你的表结构
2:打开CMD输入以下命令(进入mysql的bin目录)
d:\mysql\bin>mysql -u root -p123 test < c:/test.sql
相关推荐
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16
bianruifeng 2020-11-16