本文讲解MySQL的数据库建立和简单的操作,为后期做准备,语法大写看起来不是很舒服能用小写的我就尽量小写了 建议还是先看看mysql语法吧,我这里也是粗略的讲讲 ,如果你懂点英语,那么看起来其实也不费劲。
建立数据库
mysql> create database mysqltest;
Query OK, 1 row affected (0.00 sec)
查询所有数据库
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| mysqltest |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
使用数据库 新建一个表
mysql> use mysqltest
Database changed
mysql> create table admin (id int,username varchar(255),password varchar(255));
Query OK, 0 rows affected (0.09 sec)
查看数据库,插入,与查询
mysql> show tables;
+---------------------+
| Tables_in_mysqltest |
+---------------------+
| admin |
+---------------------+
1 row in set (0.00 sec)
mysql> insert into admin (id,username,password) values (1,"admin","admin");
Query OK, 1 row affected (0.00 sec)
mysql> select * from admin;
+------+----------+----------+
| id | username | password |
+------+----------+----------+
| 1 | admin | admin |
+------+----------+----------+
1 row in set (0.00 sec)
查询 where 语句
mysql> select * from admin where id =1;
+------+----------+----------+
| id | username | password |
+------+----------+----------+
| 1 | admin | admin |
+------+----------+----------+
1 row in set (0.00 sec)
本文很简单 意在构造一个表 为后面提供一个注入点
- author:404