当前位置:   article > 正文

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)

四、客户端访问

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码秘术家/article/detail/61891?site
推荐阅读
相关标签
  

闽ICP备14008679号