Mysql 刷库操作实例

一、文件展示:

注意:我们的刷库语句c:\db\all下面,后期cmd操作要进入该目录下

 

二、文件内容:

1. InitAll.sql 文件内容:

 

2.initDatabase.sql 文件内容:

drop database if exists test;

create database test default character set utf8;

3.initDBUser.sql 文件内容:   在第四步骤中用用户名dfbb,密码dfbb登录客户端

grant all privileges on *.* to 'dfbb'@'localhost' identified by 'dfbb';

grant all privileges on *.* to 'dfbb'@'%' identified by 'dfbb';

4.建表语句,建约束,建索引,插数据啥的sql语句自己就随意写写,这里就不做交代了

三、cmd客户端操作

Microsoft Windows [版本 10.0.16299.192]

(c) 2017 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd c:\db\all

c:\db\all>mysql -u root -p

Enter password: ****

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 27

Server version: 5.7.17 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> source initAll.sql

Query OK, 40 rows affected (3.96 sec)

Query OK, 1 row affected (0.03 sec)

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

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

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, 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)

四、客户端访问

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值