MySQL数据库以及表的管理
MySQL数据库以及表的管理
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。

mysql> help create database
Name: 'CREATE DATABASE'
Description:
Syntax:
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_specification] ... create_specification:
[DEFAULT] CHARACTER SET [=] charset_name #设置字符集
| [DEFAULT] COLLATE [=] collation_name #设置排序方式 CREATE DATABASE creates a database with the given name. To use this
statement, you need the CREATE privilege for the database. CREATE
SCHEMA is a synonym for CREATE DATABASE. URL: http://dev.mysql.com/doc/refman/5.1/en/create-database.html mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
rows in set (0.00 sec) mysql>
mysql> create database yinzhengjie;
Query OK, row affected (0.01 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| yinzhengjie |
+--------------------+
rows in set (0.00 sec) mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| yinzhengjie |
+--------------------+
rows in set (0.00 sec) mysql> create database if not exists yinzhengjie;
Query OK, row affected, warning (0.00 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| yinzhengjie |
+--------------------+
rows in set (0.00 sec) mysql>
mysql> help drop database;
Name: 'DROP DATABASE'
Description:
Syntax:
DROP {DATABASE | SCHEMA} [IF EXISTS] db_name DROP DATABASE drops all tables in the database and deletes the
database. Be very careful with this statement! To use DROP DATABASE,
you need the DROP privilege on the database. DROP SCHEMA is a synonym
for DROP DATABASE. *Important*: When a database is dropped, user privileges on the
database are not automatically dropped. See [HELP GRANT]. IF EXISTS is used to prevent an error from occurring if the database
does not exist. URL: http://dev.mysql.com/doc/refman/5.1/en/drop-database.html mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| yinzhengjie |
+--------------------+
rows in set (0.00 sec) mysql> drop database if exists yinzhengjie;
Query OK, rows affected (0.00 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
rows in set (0.00 sec) mysql>
mysql> help alter database
Name: 'ALTER DATABASE'
Description:
Syntax:
ALTER {DATABASE | SCHEMA} [db_name]
alter_specification ...
ALTER {DATABASE | SCHEMA} db_name
UPGRADE DATA DIRECTORY NAME alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name #设置字符集
| [DEFAULT] COLLATE [=] collation_name #修改排序方式 ALTER DATABASE enables you to change the overall characteristics of a
database. These characteristics are stored in the db.opt file in the
database directory. To use ALTER DATABASE, you need the ALTER privilege
on the database. ALTER SCHEMA is a synonym for ALTER DATABASE.
....
mysql>
MyISAM表,每个表有三个文件,都位于数据库目录中
tb_name.frm:表结构定义
tb_name.MYD:数据文件
tb_name.MYI:索引文件
InnoDB表,有两种存储方式
第一种(默认方式):每表有一个独立文件和一个多表共享的文件
tb_name.frm:表结构的定义,位于数据库目录中
ibdata#:共享的表空间文件,默认位于数据目录(datadir指向的目录)中
第二种(独立的表空间文件,推荐使用这一种方式):
tb_name.frm:每表有一个表结构文件
tb_name.ibd:一个独立的表空间文件
应该修改innodb_file_per_table为ON,我们可以在mysql的配置文件中的[msyqld]下的字段修改它的值为NO即可完成永久生效哟。
CREATE [TEMPORARY(临时表,保存在内存中)] TABLE [IF NOT EXISTS] tbl_name
(create_definition,...)
[table_options]
(create_definition,...)
字段的定义:字段名、类型和类型修饰符
键、索引和约束
primary key,unique key,foreign key,check
{index|key}
[table_options]
engine [=] engine_name
AUTO_INCREMENT [=] value 指定AUTO_INCREMENT的起始值
[DEFAULT] CHARACTER SET [=] charset_name 指定默认字符集
CHECKSUM [=] { | } 是否使用校验值
[DEFAULT] COLLATE [=] collation_name 排序规则
COMMENT [=] 'string' 注释
DELAY_KEY_WRITE [=] { | } 是否启用键延迟写入
ROW_FORMAT [=] {DEFAULT(默认)|DYNAMIC(动态)|FIXED(静态)|COMPRESSED(压缩)|REDUNDANT(冗余)|COMPACT(紧致)} 表格式
TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}] 表空间
mysql> help create table
Name: 'CREATE TABLE'
Description:
Syntax:
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
(create_definition,...)
[table_options]
[partition_options]
....
mysql>
查看创建表的帮助信息
mysql> select database();
+------------+
| database() |
+------------+
| NULL |
+------------+
row in set (0.00 sec) mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
rows in set (0.00 sec) mysql> create database if not exists yinzhengjie;
Query OK, row affected (0.00 sec) mysql> use yinzhengjie
Database changed
mysql>
mysql> select database();
+-------------+
| database() |
+-------------+
| yinzhengjie |
+-------------+
row in set (0.00 sec) mysql> create table t1 (Name varchar() not null,Age tinyint unsigned not null,primary key(Name,Age)); #创建一个表,定义Name字段类型自动变化长度的字符类型(varchar),不能为空,定义一个Age字段类型为微整形(tinyint),也不能为空,定义主键(primary key)是Name和Age两个字段。
Query OK, rows affected (0.08 sec) mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
创建一个表包含主键的表
mysql> show table status like 't1'\G; #查看之前创建表的存储引擎。
*************************** . row ***************************
Name: t1
Engine: MyISAM
Version:
Row_format: Dynamic
Rows:
Avg_row_length:
Data_length:
Max_data_length:
Index_length:
Data_free:
Auto_increment: NULL
Create_time: -- ::
Update_time: -- ::
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
row in set (0.00 sec) ERROR:
No query specified mysql>
mysql> drop table t1;
Query OK, rows affected (0.00 sec) mysql> create table t1 (Name varchar() not null,Age tinyint unsigned not null,primary key(Name,Age)) engine='InnoDB';
Query OK, rows affected (0.05 sec) mysql> show table status like 't1'\G;
*************************** . row ***************************
Name: t1
Engine: InnoDB
Version:
Row_format: Compact
Rows:
Avg_row_length:
Data_length:
Max_data_length:
Index_length:
Data_free:
Auto_increment: NULL
Create_time: -- ::
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
row in set (0.00 sec) ERROR:
No query specified mysql>
创建表的存储引擎
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_options]
select_statement #将select的结果来作为字段创建新表的字段,但是可能失去属性定义的。
用法格式
mysql> select * from t1;
Empty set (0.01 sec) mysql>
mysql> insert into t1(Name,Age) values ("yinzhengjie",);
Query OK, row affected (0.00 sec) mysql>
mysql> select * from t1;
+-------------+-----+
| Name | Age |
+-------------+-----+
| yinzhengjie | |
+-------------+-----+
row in set (0.00 sec) mysql>
mysql> create table t2 select * from t1;
Query OK, row affected (0.01 sec)
Records: Duplicates: Warnings: mysql> select * from t2;
+-------------+-----+
| Name | Age |
+-------------+-----+
| yinzhengjie | |
+-------------+-----+
row in set (0.00 sec) mysql>
mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql> desc t2; #我们可以发现t2的表中的字段属性和t1的并不一致哟!只是数值一致而已。
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | | NULL | |
| Age | tinyint() unsigned | NO | | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
案例展示
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
{ LIKE old_tbl_name | (LIKE old_tbl_name) }
用法格式
mysql> select database();
+-------------+
| database() |
+-------------+
| yinzhengjie |
+-------------+
row in set (0.00 sec) mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| t1 |
| t2 |
+-----------------------+
rows in set (0.00 sec) mysql> create table t3 like t1;
Query OK, rows affected (0.04 sec) mysql> select * from t3;
Empty set (0.01 sec) mysql> desc t3;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.01 sec) mysql>
用法展示
DROP [TEMPORARY] TABLE [IF EXISTS]
tbl_name [, tbl_name] ...
[RESTRICT | CASCADE]
用法格式
mysql> select database();
+-------------+
| database() |
+-------------+
| yinzhengjie |
+-------------+
row in set (0.00 sec) mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| t1 |
| t2 |
| t3 |
+-----------------------+
rows in set (0.00 sec) mysql> drop table t2,t3;
Query OK, rows affected (0.07 sec) mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| t1 |
+-----------------------+
row in set (0.00 sec) mysql>
用法展示
ALTER TABLE tbl_name
[alter_specification [, alter_specification] ...]
修改字段定义:
插入新字段:
ADD [COLUMN] col_name column_definition
[FIRST | AFTER col_name ]
删除字段
DROP [COLUMN] col_name
修改字段
修改字段名称
CHANGE [COLUMN] old_col_name new_col_name column_definition
[FIRST|AFTER col_name]
修改字段类型及属性等
MODIFY [COLUMN] col_name column_definition
[FIRST | AFTER col_name]
表改名:
rename to|as new tb_name
修改存储引擎
engine =
指定排序标准的字段
ORDER BY col_name [, col_name] ...
用法格式集合
mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql> alter table t1 add ID tinyint unsigned not null;
Query OK, row affected (0.02 sec)
Records: Duplicates: Warnings: mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
| ID | tinyint() unsigned | NO | | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
插入新字段用法展示
mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
| ID | tinyint() unsigned | NO | | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
mysql> alter table t1 add Gender enum('boy','girl') not null default 'boy' after Age; #插入的字段我们用关键字“after”指定在“Age”之后。(注意,如果你使用first则表示插入在第一个字段哟)
Query OK, row affected (0.05 sec)
Records: Duplicates: Warnings: mysql> desc t1;
+--------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
| Gender | enum('boy','girl') | NO | | boy | |
| ID | tinyint() unsigned | NO | | NULL | |
+--------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
插入指定的位置用法展示
mysql> desc t1;
+--------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
| Gender | enum('boy','girl') | NO | | boy | |
| ID | tinyint() unsigned | NO | | NULL | |
+--------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
mysql> alter table t1 drop Gender;
Query OK, row affected (0.02 sec)
Records: Duplicates: Warnings: mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
| ID | tinyint() unsigned | NO | | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
删除字段案例展示
mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
| ID | tinyint() unsigned | NO | | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql> alter table t1 modify ID tinyint unsigned not null first;
Query OK, row affected (0.02 sec)
Records: Duplicates: Warnings: mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| ID | tinyint() unsigned | NO | | NULL | |
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
修改字段类型及属性等(改变字段的位置)
mysql> desc t1;
+-------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+---------+-------+
| ID | tinyint() unsigned | NO | | NULL | |
| Name | varchar() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql> alter table t1 change Name StudentName char() not null;
Query OK, row affected (0.03 sec)
Records: Duplicates: Warnings: mysql> desc t1;
+-------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------------+------+-----+---------+-------+
| ID | tinyint() unsigned | NO | | NULL | |
| StudentName | char() | NO | PRI | NULL | |
| Age | tinyint() unsigned | NO | PRI | NULL | |
+-------------+---------------------+------+-----+---------+-------+
rows in set (0.00 sec) mysql>
修改字段名称
mysql> show indexes from t1; #查看当前索引信息
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| t1 | | PRIMARY | | StudentName | A | | NULL | NULL | | BTREE | |
| t1 | | PRIMARY | | Age | A | | NULL | NULL | | BTREE | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
rows in set (0.00 sec) mysql> alter table t1 add index(StudentName); #创建一个索引
Query OK, row affected (0.02 sec)
Records: Duplicates: Warnings: mysql> show indexes from t1;
+-------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| t1 | | PRIMARY | | StudentName | A | | NULL | NULL | | BTREE | |
| t1 | | PRIMARY | | Age | A | | NULL | NULL | | BTREE | |
| t1 | | StudentName | | StudentName | A | | NULL | NULL | | BTREE | |
+-------+------------+-------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
rows in set (0.00 sec) mysql> alter table t1 drop INDEX StudentName; #删除索引信息
Query OK, row affected (0.04 sec)
Records: Duplicates: Warnings: mysql> show indexes from t1;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| t1 | | PRIMARY | | StudentName | A | | NULL | NULL | | BTREE | |
| t1 | | PRIMARY | | Age | A | | NULL | NULL | | BTREE | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
rows in set (0.00 sec) mysql>
创建索引和删除索引用法展示
mysql> select database();
+-------------+
| database() |
+-------------+
| yinzhengjie |
+-------------+
row in set (0.01 sec) mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| t1 |
+-----------------------+
row in set (0.00 sec) mysql> alter table t1 rename to mysql_test_table; #可以用alter命令进行修改标明
Query OK, rows affected (0.00 sec) mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| mysql_test_table |
+-----------------------+
row in set (0.00 sec) mysql>
mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| mysql_test_table |
+-----------------------+
row in set (0.00 sec) mysql> rename table mysql_test_table to t1; #当然我们也可以直接用rename命令进行修改哟~
Query OK, rows affected (0.01 sec) mysql> show tables;
+-----------------------+
| Tables_in_yinzhengjie |
+-----------------------+
| t1 |
+-----------------------+
row in set (0.00 sec) mysql>
修改表名的两种常见的姿势
mysql> show table status like 't1'\G
*************************** . row ***************************
Name: t1
Engine: InnoDB
Version:
Row_format: Compact
Rows:
Avg_row_length:
Data_length:
Max_data_length:
Index_length:
Data_free:
Auto_increment: NULL
Create_time: -- ::
Update_time: NULL
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
row in set (0.00 sec) mysql> alter table t1 engine=MyISAM;
Query OK, row affected (0.02 sec)
Records: Duplicates: Warnings: mysql> show table status like 't1'\G
*************************** . row ***************************
Name: t1
Engine: MyISAM
Version:
Row_format: Fixed
Rows:
Avg_row_length:
Data_length:
Max_data_length:
Index_length:
Data_free:
Auto_increment: NULL
Create_time: -- ::
Update_time: -- ::
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
row in set (0.00 sec) mysql>
修改表选项案例展示
MySQL数据库以及表的管理的更多相关文章
- MySQL库和表的管理
MySQL数据库服务配置好后,系统会有4个默认的数据库. information_schema:虚拟对象,其对象都保存在内存中performance_schema:服务器性能指标库mysql:记录用户 ...
- MySql数据库创建表
3.3.MySql数据库创建表 创建5个表: UserInfo用户基础表 Role 角色表 MenuInfo 菜单即控制表 Relation_Role_Menu 角色对应菜单关系表 RelaTion_ ...
- MySQL基础知识:创建MySQL数据库和表
虚构一个微型在线书店的数据库和数据,作为后续MySQL脚本的执行源,方便后续MySQL和SQL的练习. 在虚构这个库的过程中,主要涉及的是如何使用命令行管理 MySQL数据库对象:数据库.表.索引.外 ...
- 10款最好用的MySQL数据库客户端图形界面管理工具
MySQL Workbench 该工具由MySQL开发,是一个跨平台的可视化数据库设计工具.它是DBDesigner4项目备受期待的替代者,它是一个本地图形化工具,支持的操作系统包括Windows.L ...
- MySQL数据库分表的3种方法
原文地址:MySQL数据库分表的3种方法作者:dreamboycx 一,先说一下为什么要分表 当一张的数据达到几百万时,你查询一次所花的时间会变多,如果有联合查询的话,我想有可能会死在那儿了.分表的目 ...
- mysql数据库单表只有一个主键自增id字段,ibatis实现id自增
mysql数据库单表只有一个主键自增id字段,ibatis实现id自增 <insert id="autoid"> insert into user_id ...
- Vc数据库编程基础MySql数据库的表查询功能
Vc数据库编程基础MySql数据库的表查询功能 一丶简介 不管是任何数据库.都会有查询功能.而且是很重要的功能.上一讲知识简单的讲解了表的查询所有. 那么这次我们需要掌握的则是. 1.使用select ...
- Vc数据库编程基础MySql数据库的表增删改查数据
Vc数据库编程基础MySql数据库的表增删改查数据 一丶表操作命令 1.查看表中所有数据 select * from 表名 2.为表中所有的字段添加数据 insert into 表名( 字段1,字段2 ...
- mysql数据库user表host字段的%问题
搜索: mysql数据库user表host字段的%问题 连接:http://blog.csdn.net/xiaomengh/article/details/48706149 在mysql数据库中,使用 ...
随机推荐
- 51nod 小朋友的笑话
链接 分析: 每次操作把以前没有出现这个数的设为1,有这个数的设为0.首先将当前区间设为1,考虑有set维护这个颜色出现的区间,然后把所有与当前区间相交的拿出来,修改为0. 复杂度?每次操作的线段只会 ...
- 洛咕 P4474 王者之剑
宝石只能在偶数秒取到,假设有一个宝石在奇数秒取到了,那么上一秒是偶数秒,在上一秒的时候这里的宝石就没了. 相邻的两个宝石不能同时取,很显然,先取一块,那么这是偶数秒,取完了这一块之后相邻的都没了. 只 ...
- Ajax 上传文件(input file FormData)
FormData对象用以将数据编译成键值对,以便用XMLHttpRequest来发送数据.其主要用于发送表单数据,但亦可用于发送带键数据(keyed data),而独立于表单使用. jQuery Aj ...
- Grid布局20行代码快速生成瀑布流
网格布局 Grid 布局,好用又简单,至少比 Flex 要人性化一点,美中不足就是浏览器支持度差点. DOM结构 中间夹层为了后续拓展. CSS .grid { display: grid; grid ...
- AppStore下载Xcode的文件
有的时候团队开发,手机系统一升级,那么对应的Xcode也就需要升级了,由于团队开发,可能一下要把所有人的都升级一下,那么最简单的就是下好一份Xcode然后分享给大家. 但是有的时候你就会发现,通过Ap ...
- Jmeter(二十三)_插件扩展
Jmeter插件管理器 安装插件的方法有两种,一种是传统的方式,即官网下载,本地配置,重启jmeter.现在有一种快捷的方法可以自定义安装插件-插件管理器 JMeter 插件管理器的使用方法很简单:不 ...
- 这可能是最详细的Python文件操作
删除 # ==================删除==================# 只能删除文件,若为目录则报错# 若文件正在使用,Windows下会直接报错,Linux下会在目录表中删除记录, ...
- CommandoVM-虚拟机映像文件 | VM打开直接用
呵呵!自从火眼发布了这个CommandoVM,想必大家应该都挺激动,然而实际操作一下,基本炸裂-- 因为并没有给类似于kali这种直接安装的现成镜像,而是要通过github的脚本去完全网络安装 实际操 ...
- OD之破解密钥文件授权(三)
除了上次的序列号验证以外,还有这种密钥授权模式,需要密钥文件授权才能打开文件; 老办法,先拖进OD中动态分析再说: 然后F8进行调试这时候发现了一个条件跳转函数jnz下面是说跳转未实现,那我们发现上面 ...
- MVC模式简单的Xml文档解析加Vue渲染
前端代码: <script src="~/Js/jquery-3.3.1.min.js"></script> <script src="~/ ...