赞
踩
一、文件展示:
注意:我们的刷库语句放在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)
四、客户端访问
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。