mysql 怎么导入sql文件_MySql 中导入sql文件

使用控制台执行:

D:\mysql-5.6.26-winx64\bin>mysql -uroot -proot

mysql> source C:\Users\Administrator\Desktop\seckill\src\schema.sql

Database changed

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> drop table  if exists seckill_user;

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> source C:\Users\Administrator\Desktop\seckill\src\schema.sql

Database changed

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.06 sec)

Query OK, 0 rows affected (0.04 sec)

Query OK, 4 rows affected (0.01 sec)

Records: 4  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected (0.03 sec)

mysql> drop table if exists `user`;

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> create table `user`(

->  `id` bigint(20) not null auto_increment,

->  `password` varchar(45) not null,

->  `name` varchar(45) not null,

->  `login_time` datetime not null,

->  `create_time` datetime not null,

->  `update_time` datetime not null,

->  primary key(`id`),

->  unique key `user_name_UNIQUE`(`name`)

-> )engine=InnoDB default charset=utf8;

Query OK, 0 rows affected (0.07 sec)

mysql>

mysql>

mysql> create table `order_basic`(

->  `id` bigint(20) unsigned not null auto_increment,

->  `user_id` bigint(20) unsigned not null comment '用户id',

->  `order_status` int(4) not null comment '订单状态',

->  `total_price` int(11) not null comment '订单总价',

->  `total_settlement_price` int(11) not null comment '订单结算总价',

->  `address` mediumtext comment '收货地址',

->  `receiver` varchar(128) not null comment '收件人',

->  `phone` varchar(20) not null comment '电话',

->  `pay_type` int(2) default '0' comment '支付方式:1微信 2支付宝 3货到付款

',

->  `create_time` datetime not null,

->  `update_time` datetime not null,

->  primary key(`id`),

->  key `order_user_INDEX` (`user_id`)

-> )engine=InnoDB default charset=utf8;

Query OK, 0 rows affected (0.07 sec)

mysql>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值