MySQL 02 初体验

文章目录

  • MySQL 02 初体验
    • 一、学习目标
    • 二、MySQL简介
    • 三、MySQL服务启动与关闭
    • 四、MySQL登录
    • 五、MySQL配置文件
    • 六、MySQL安装目录
    • 七、MySQL存储引擎
    • 八、MySQL运行机制
    • 九、系统数据库和用户数据库
    • 十、创库删库选择库
    • 十一、结构化查询语言
    • 十二、MySQL数据类型——数值类型
    • 十三、MySQL数据类型——字符串、日期类型
    • 十四、创表、删表
    • 十五、字段的约束及属性
    • 十六、创建病人信息表
    • 十七、MySQL8.0数据表的存储文件介绍
    • 十八、MySQL系统帮助
    • 十九、本章总结

一、学习目标

  1. 掌握MySQL在Windows系统中的安装方法
  2. 学会使用Navicat数据库管理工具
  3. 掌握MySQL命令行操作数据库常用命令
  4. 掌握创建库的SQL语句
  5. 掌握创建数据表以及数据字段的类型和属性

二、MySQL简介

MySQL 是最流行的关系型数据库管理系统,在 WEB 应用方面 MySQL 是最好的 RDBMS(Relational Database Management System:关系数据库管理系统)应用软件之一。

MySQL 是一个关系型数据库管理系统,由瑞典 MySQL AB 公司开发,目前属于 Oracle 公司。MySQL 是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性。

MySQL 是开源的。
MySQL 支持大型的数据库。可以处理拥有上千万条记录的大型数据库。
MySQL 使用标准的 SQL 数据语言形式。
MySQL 可以运行于多个系统上,并且支持多种语言。这些编程语言包括 C、C++、Python、Java、Perl、PHP、Eiffel、Ruby 和 Tcl 等。
MySQL 支持大型数据库,支持 5000 万条记录的数据仓库,32 位系统表文件最大可支持 4GB,64 位系统支持最大的表文件为8TB。
MySQL 是可以定制的,采用了 GPL 协议,你可以修改源码来开发自己的 MySQL 系统。

MySQL的优势

  1. 运行速度快
  2. 使用成本低
  3. 可移植性强
  4. 适用用户广

MySql下载地址:https://dev.mysql.com/downloads/installer/

三、MySQL服务启动与关闭

方式一: 打开系统开始菜单——>搜索 “服务” 或者在"运行" 中输入services.msc打开Windows系统服务

方式二: 使用cmd命令启动

net start mysql服务名字

cmd停止MySQL服务命令:

更改cmd默认以管理员的身份运行

四、MySQL登录

方式一:使用MySQL Command Line Client


方式二:使用DOS

前提要求:需要配置好MySQL环境变量 PATH:

服务启动语法:

mysql –h服务器主机地址 –u 用户名 –p密码

命令: mysql -uroot -p 按回车键

C:\WINDOWS\system32>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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>

启动常见错误:

错误原因: 服务未启动

显示所有数据库:

show databases;
#选中数据库
use 数据库的名称

显示所有表:

show tables;

回顾常用的sql语句

#查询
select * from 表名;
select * from 表名 [where 查询条件]; #and or
select * from 表名 [where 查询条件]
[order by 排序列 (ASC|DESC)]
#新增
insert into 表名(列名1,列名2,列名n)
values ('值1','值2','值n');
#删除
delete from 表名 [where 删除条件]
#修改
update 表名 set 列名1='值1',列名2='值2',列名n='值n'
[where 修改条件]

注意事项:

  • 连接MySQL服务前必须先检查服务是否启动

  • 启动方式有两种,可以点击右键-属性,在属性窗口中设计 ,也可以在DOS中使用net start mysql命令启动服务

  • 如何修改了配置文件my.ini,密码重启服务后才能生效

五、MySQL配置文件

当打开my.ini文件查可以看几个常用配置参数
通过修改MySQL配置文件来手动配置数据库服务器MySQL时,常用的参数如下。

  1. default-character-set:客户端默认字符集
  2. character-set-server:服务器端默认字符集
  3. port:客户端和服务器端的端口号 3306
  4. default-storage-engine:MySQL默认存储引擎

my.ini配置信息:

[client]
# pipe=# socket=MYSQL
port=3306[mysql]
no-beep
# default-character-set=# SERVER SECTION
# ----------------------------------------------------------------------
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
# server_type=3
[mysqld]# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory# shared-memory-base-name=MYSQL# The Pipe the MySQL Server will use
# socket=MYSQL# The TCP/IP Port the MySQL Server will listen on
port=3306# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 8.0/"# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 8.0\Data# The default character set that will be used when a new schema or table is
# created and no character set is defined
# character-set-server=# The default authentication plugin to be used when connecting to the server
default_authentication_plugin=caching_sha2_password# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"# General and Slow logging.
log-output=FILEgeneral-log=0general_log_file="LAPTOP-M7EOS388.log"slow-query-log=1slow_query_log_file="LAPTOP-M7EOS388-slow.log"long_query_time=10# Error Logging.
log-error="LAPTOP-M7EOS388.err"# ***** Group Replication Related *****
# Specifies the base name to use for binary log files. With binary logging
# enabled, the server logs all statements that change data to the binary
# log, which is used for backup and replication.
log-bin="LAPTOP-M7EOS388-bin"# ***** Group Replication Related *****
# Specifies the server ID. For servers that are used in a replication topology,
# you must specify a unique server ID for each replication server, in the
# range from 1 to 2^32 − 1. “Unique” means that each ID must be different
# from every other ID in use by any other source or replica.
server-id=1# ***** Group Replication Related *****
# The host name or IP address of the replica to be reported to the source
# during replica registration. This value appears in the output of SHOW REPLICAS
# on the source server. Leave the value unset if you do not want the replica to
# register itself with the source.
# report_host=0.0# NOTE: Modify this value after Server initialization won't take effect.
lower_case_table_names=1# Secure File Priv.
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 8.0/Uploads"# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=151# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section [mysqld_safe]
table_open_cache=2000# Maximum size for internal (in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size=76M# How many threads we should keep in a cache for reuse. When a client
# disconnects, the client's threads are put in the cache if there aren't
# more than thread_cache_size threads from before.  This greatly reduces
# the amount of thread creations needed if you have a lot of new
# connections. (Normally this doesn't give a notable performance
# improvement if you have a good thread implementation.)
thread_cache_size=10#*** MyISAM Specific options
# The maximum size of the temporary file MySQL is allowed to use while
# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
# If the file-size would be bigger than this, the index will be created
# through the key cache (which is slower).
myisam_max_sort_file_size=100G# The size of the buffer that is allocated when sorting MyISAM indexes
# during a REPAIR TABLE or when creating indexes with CREATE INDEX
# or ALTER TABLE.
myisam_sort_buffer_size=142M# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size=8M# Size of the buffer used for doing full table scans of MyISAM tables.
# Allocated per thread, if a full scan is needed.
read_buffer_size=64Kread_rnd_buffer_size=256K#*** INNODB Specific options ***
# innodb_data_home_dir=# Use this option if you have a MySQL server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
# and speed up some things.
# skip-innodb# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=1# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size=1M# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system.  Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size=8M# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=48M# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency=17# The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.
innodb_autoextend_increment=64# The number of regions that the InnoDB buffer pool is divided into.
# For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,
# by reducing contention as different threads read and write to cached pages.
innodb_buffer_pool_instances=8# Determines the number of threads that can enter InnoDB concurrently.
innodb_concurrency_tickets=5000# Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before
# it can be moved to the new sublist.
innodb_old_blocks_time=1000# It specifies the maximum number of .ibd files that MySQL can keep open at one time. The minimum value is 10.
innodb_open_files=300# When this variable is enabled, InnoDB updates statistics during metadata statements.
innodb_stats_on_metadata=0# When innodb_file_per_table is enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes for each newly created table
# in a separate .ibd file, rather than in the system tablespace.
innodb_file_per_table=1# Use the following list of values: 0 for crc32, 1 for strict_crc32, 2 for innodb, 3 for strict_innodb, 4 for none, 5 for strict_none.
innodb_checksum_algorithm=0# The number of outstanding connection requests MySQL can have.
# This option is useful when the main MySQL thread gets many connection requests in a very short time.
# It then takes some time (although very little) for the main thread to check the connection and start a new thread.
# The back_log value indicates how many requests can be stacked during this short time before MySQL momentarily
# stops answering new requests.
# You need to increase this only if you expect a large number of connections in a short period of time.
back_log=80# If this is set to a nonzero value, all tables are closed every flush_time seconds to free up resources and
# synchronize unflushed data to disk.
# This option is best used only on systems with minimal resources.
flush_time=0# The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use
# indexes and thus perform full table scans.
join_buffer_size=256K# The maximum size of one packet or any generated or intermediate string, or any parameter sent by the
# mysql_stmt_send_long_data() C API function.
max_allowed_packet=4M# If more than this many successive connection requests from a host are interrupted without a successful connection,
# the server blocks that host from performing further connections.
max_connect_errors=100# Changes the number of file descriptors available to mysqld.
# You should try increasing the value of this option if mysqld gives you the error "Too many open files".
open_files_limit=4161# If you see many sort_merge_passes per second in SHOW GLOBAL STATUS output, you can consider increasing the
# sort_buffer_size value to speed up ORDER BY or GROUP BY operations that cannot be improved with query optimization
# or improved indexing.
sort_buffer_size=256K# The number of table definitions (from .frm files) that can be stored in the definition cache.
# If you use a large number of tables, you can create a large table definition cache to speed up opening of tables.
# The table definition cache takes less space and does not use file descriptors, unlike the normal table cache.
# The minimum and default values are both 400.
table_definition_cache=1400# Specify the maximum size of a row-based binary log event, in bytes.
# Rows are grouped into events smaller than this size if possible. The value should be a multiple of 256.
binlog_row_event_max_size=8K# If the value of this variable is greater than 0, a replica synchronizes its master.info file to disk.# If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk.
# (using fdatasync()) after every sync_relay_log writes to the relay log.
sync_relay_log=10000# If the value of this variable is greater than 0, a replica synchronizes its relay-log.info file to disk.
# (using fdatasync()) after every sync_relay_log_info transactions.
sync_relay_log_info=10000# Load mysql plugins at start."plugin_x ; plugin_y".
# plugin_load# The TCP/IP Port the MySQL Server X Protocol will listen on.
loose_mysqlx_port=33060

六、MySQL安装目录

主要文件夹

  1. bin文件夹:该文件夹下存放着可执行文件
  2. include文件夹: 该文件夹下存放着头文件
  3. lib文件夹: 该文件夹下存放着库文件
  4. share文件夹:该文件夹下存放着字符集、语言等信息。

七、MySQL存储引擎

存储引擎的类型
MyISAM、InnoDB 、Memory、CSV等9种

MyISAM与InnoDB类型主要区别

名称 InnoDB MyISAM
事务处理 支持 不支持
数据行锁定 支持 不支持
外键约束 支持 不支持
全文索引 不支持 支持
表空间大小 较大约2倍 较小

适用场合

  • 使用 MyISAM: 不需事务,空间小,以查询访问为主
  • 使用 InnoDB: 多删除、更新操作,安全性高,事务处理及并发控制

查看当前默认存储引擎

show variables like 'storage_engine%';

修改存储引擎

  • 修改my.ini配置文件
default-storage-engine= InnoDB

设置表的存储引擎

#语法:
CREATE TABLE 表名(#省略代码
)ENGINE=存储引擎;#示例:
CREATE TABLE `myIsam` (id  INT(4)
)ENGINE=MyISAM;

八、MySQL运行机制

运行机制图解:

运行机制分析:

如上图所示,当应用程序发送一个查询请求到MySQL服务器时,如 select * from tableName ,从支持接口进来后,进入连接池后做权限、验证等环节,然后判断是否有缓存,有则直接放回结果,否则进入SQL接口,在查询之前查询优化器进行优化,最后进行解析,查询。并通过存储引擎与文件交互。

名词解释:

**1.支持接口:**不同的编程语言与SQL的交互

**2.连接池:**管理缓冲用户连接,线程处理等需要缓存的需求

**3.SQL接口:**接受用户的SQL命令,并且返回用户需要查询的结果。比如select from就是调用SQL接口

**4.解析器:**SQL命令传递到解析器的时候会被解析器验证和解析。解析器是由Lex和YACC实现的,是一个很长的脚本。
主要功能:
a . 将SQL语句分解成数据结构,并将这个结构传递到后续步骤,以后SQL语句的传递和处理就是基于这个结构的;例如将 select * from tablename where 1=1;分解为select、*、from、tablename、where 、1=1,并去解析。
如果在分解构成中遇到错误,那么就说明这个SQL语句是不合理的。

5.查询优化器:

SQL语句在查询之前会使用查询优化器对查询进行优化。他使用的是“选取-投影-联接”策略进行查询。
例: select id,name from user where gender = 1;
a.先根据where 语句进行选取,而不是先将表全部查询出来以后再进行gender过滤
b.先根据id和name进行属性投影,而不是将属性全部取出以后再进行过滤
将这两个查询条件联接起来生成最终查询结果。

6.缓存:

如果查询缓存有命中的查询结果,查询语句就可以直接去查询缓存中取数据。
这个缓存机制是由一系列小缓存组成的。比如表缓存,记录缓存,key缓存,权限缓存等

7.存储引擎:

存储引擎是MySql中具体的与文件打交道的子系统。也是MySql最具有特色的一个地方。

MySql的存储引擎是插件式的。它根据MySql AB公司提供的文件访问层的一个抽象接口来定制一种文件访问机制(这种访问机制就叫存储引擎)。

现在有很多种存储引擎,各个存储引擎的优势各不一样,最常用的MyISAM,InnoDB,BDB。

MyISAM引擎,它查询速度快,有较好的索引优化和数据压缩技术。但是它不支持事务。

InnoDB支持事务,并且提供行级的锁定,应用也相当广泛。 Mysql也支持自己定制存储引擎,甚至一个库中不同的表使用不同的存储引擎,这些都是允许的

MySQL默认使用InnoDB存储引擎

九、系统数据库和用户数据库

安装完MySQL服务器后,MySQL会附带系统数据库,包括:

information_schema:主要存储系统中的一些数据库对象信息,如用户表信息、字段信息、权限信息、字符集信息和分区信息等。

performance_schema:主要存储数据库服务器性能参数

mysql:主要存储系统的用户权限信息

test:MySQL数据库管理系统自动创建的测试数据库,任何用户都可以使用

十、创库删库选择库

创库语法:

CREATE DATABASE 数据库名;

创库示例:

CREATE DATABASE hospitaldb;

删库语法:

DROP DATABASE 数据库名;

删库示例:

DROP DATABASE hospitaldb;

选择库语法:

USE 数据库名字;

选择库示例:

USE hospitaldb;

注意: 分号为结束符,不可缺!

十一、结构化查询语言

SQL语言包括以下4个部分。
(1)DML(数据操作语言):用来插入、修改和删除表中的数据,如:INSERT、UPDATE、DELETE语句。
(2)DDL(数据定义语言):在数据库中创建或删除数据库对象等操作。如:CREATE、DROP、ALTER等语句。
(3)DQL(数据查询语言):用来对数据库中的数据进行查询,指SELECT语句。
(4)DCL(数据控制语言):用来控制数据库组件的存取许可、存取权限等,如GRANT、REVOKE等。

十二、MySQL数据类型——数值类型

UNSIGNED属性

  • 标识为无符号数

ZEROFILL属性

  • 宽度(位数)不足以0填充,假设id int(4)当数值为12时,则呈现:0012

注意:若某数值字段指定了ZEROFILL属性,将自动添加UNSIGNED属性

十三、MySQL数据类型——字符串、日期类型

注意:若某日期字段默认值为当前日期,一般设置为TIMESTAMP类型

十四、创表、删表

创表语法:

CREATE TABLE [IF NOT EXISTS]  表名 (字段1 数据类型 [字段属性|约束][索引][注释],……字段n 数据类型 [字段属性|约束][索引][注释]
)[表类型][表字符集][注释];

创表示例:

#创建学生表
CREATE TABLE `patient` (
`patientID` INT  PRIMARY KEY, #多字段使用逗号分隔
`address` VAVCHAR(255),#保留字用撇号括起来
……);#单行注释:#......
#多行注释:/*……*/

删表语法:

DROP TABLE [IF EXISTS] 表名;

删表示例:

DROP TABLE IF EXISTS patient;

十五、字段的约束及属性

主键、默认、唯一约束

CREATE TABLE patient(`patientID` INT NOT NULL PRIMARY KEY,#主键设置`address` VAVCHAR(255) DEFAULT '地址不详',#默认值设置`identityNum` varchar(18)  UNIQUE KEY,#唯一约束
……);

添加字段和表注释

CREATE TABLE patient (`patientID` INT UNSIGNED COMMENT ‘病人编号’
)COMMENT='病人信息表’;

设置字符集编码

CREATE TABLE [IF NOT EXISTS] 表名(#省略代码
)CHARSET = 字符集名;
名称 关键字 说明
非空约束 NOT NULL 字段不允许为空
默认约束 DEFAULT 赋予某字段默认值
唯一约束 UNIQUE KEY(UK) 设置字段的值是唯一的 允许为空,但只能有一个空值
主键约束 PRIMARY KEY(PK) 设置该字段为表的主键 可唯一标识该表记录
外键约束 FOREIGN KEY(FK) 用于在两表之间建立关系, 需要指定引用主表的哪一字段
自动增长 AUTO_INCREMENT 设置该列为自增字段 默认每条自增1 通常用于设置主键

十六、创建病人信息表

病人信息表

#选择hospital数据库
USE hospital;
#创建Patient表
CREATE TABLE IF NOT EXISTS patient(patientID INT(4) NOT NULL COMMENT '病人编号' PRIMARY KEY AUTO_INCREMENT, #非空,主键,自增password VARCHAR(20) NOT NULL COMMENT '登录密码',birthDate DATE COMMENT '出生日期',gender VARCHAR(4) DEFAULT '男' NOT NULL COMMENT '性别',#非空,默认值“男”patientName VARCHAR(50) NOT NULL COMMENT '病人姓名',phoneNum VARCHAR(50) COMMENT '联系电话',email VARCHAR(70) COMMENT '邮箱',identityNum VARCHAR(20) UNIQUE KEY COMMENT '身份证号', #唯一address VARCHAR(255) DEFAULT '地址不详' COMMENT '地址' #默认值“地址不详”
)COMMENT='病人表'; #表注释“病人表”#查看数据库中的表
show tables;#查看表结构
describe patient;

十七、MySQL8.0数据表的存储文件介绍

MyISAM类型表文件
*.sdi:表结构元数据
*.MYD:数据文件
*.MYI:索引文件
InnoDB类型表文件
*.ibd:数据文件

注意: 存储位置因操作系统而异,可查看 my.ini 文件

#数据库创建
create database t147myschool;
use t147myschool;
#表的创建(DDL)
create table grade(gradeId int not null comment'年级编号',gradeName varchar(20) comment '年级名称'
)comment='年级信息表';
#创建学生表
create table if not exists Student(StudentNo int not null primary key comment '学生学号',StudentName varchar(20) not null comment '学生姓名',Sex char(2) not null default '男' comment '性别',Birthday date  not null comment '出生日期',GradeId int not null comment '年级编号(外键)',Phone char(11) comment '手机号码',Address  varchar(100) default '地址不详' comment '地址',IDCard char(18) unique key comment '身份证号码'
)comment='学生信息表',engine=InnoDB;#创建科目表
create  table  if not exists `subject`(subjectNo int primary key not null comment '科目编号',subjectName varchar(20) not null comment '科目名字',classHour int not null comment '课时',gradeId int not null comment '年级编号(外键)'
)comment ='科目信息表',engine=MYISAM;

十八、MySQL系统帮助

语法:

HELP 查询内容;

示例:

HELP contents;
HELP Data Types;
HELP INT;

dos命令运行示例:

Microsoft Windows [版本 10.0.19042.1586]
(c) Microsoft Corporation。保留所有权利。C:\WINDOWS\system32>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.26 MySQL Community Server - GPLCopyright (c) 2000, 2021, Oracle and/or its affiliates.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> HELP contents;
You asked for help about help category: "Contents"
For more information, type 'help <item>', where <item> is one of the following
categories:Account ManagementAdministrationComponentsCompound StatementsContentsData DefinitionData ManipulationData TypesFunctionsGeographic FeaturesHelp MetadataLanguage StructureLoadable FunctionsPluginsPrepared StatementsReplication StatementsStorage EnginesTable MaintenanceTransactionsUtilitymysql> HELP Data Types;
You asked for help about help category: "Data Types"
For more information, type 'help <item>', where <item> is one of the following
topics:AUTO_INCREMENTBIGINTBINARYBITBLOBBLOB DATA TYPEBOOLEANCHARCHAR BYTEDATEDATETIMEDECDECIMALDOUBLEDOUBLE PRECISIONENUMFLOATINTINTEGERLONGBLOBLONGTEXTMEDIUMBLOBMEDIUMINTMEDIUMTEXTSET DATA TYPESMALLINTTEXTTIMETIMESTAMPTINYBLOBTINYINTTINYTEXTVARBINARYVARCHARYEAR DATA TYPEmysql> HELP INT;
Name: 'INT'
Description:
INT[(M)] [UNSIGNED] [ZEROFILL]A normal-size integer. The signed range is -2147483648 to 2147483647.
The unsigned range is 0 to 4294967295.URL: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html

十九、本章总结

MySQL 02 初体验相关推荐

  1. Mysql数据库(一)——mysql数据库初体验

    Mysql数据库(一)--mysql数据库初体验 一.数据库的概念 1.数据库的组成 ①.表 ②.数据库 2.数据库类型 ①.关系型数据库 ②.非关系型数据库(NoSQL (Not Only SQL) ...

  2. MySQL数据库初体验

    文章目录 一.MySQL数据库初体验 1.数据库的基本概念 2.数据库系统发展史 2.1文件管理系统的缺点 2.2数据库系统发展阶段 3.数据库原理 3.1数据的时代 3.2数据的分类 3.3DBMS ...

  3. Net Core平台灵活简单的日志记录框架NLog+Mysql组合初体验

    Net Core平台灵活简单的日志记录框架NLog初体验 前几天分享的"[Net Core集成Exceptionless分布式日志功能以及全局异常过滤][https://www.cnblog ...

  4. MySQL入门学习之——MySQL Cluster初体验

    最近有一位朋友咨询了我一个MySQL Cluster的问题,实话实说,这个东东我还没玩过,不过既然遇到了它,那么就开始体验一把吧.朋友的问题如下: "MySQL集群是不是只能新增数据同步,而 ...

  5. Net Core平台灵活简单的日志记录框架NLog+SqlServer初体验

    Net Core平台灵活简单的日志记录框架NLog+SqlServer初体验 前几天分享的"[Net Core平台灵活简单的日志记录框架NLog+Mysql组合初体验][http://www ...

  6. yii schema.mysql.sql_YII学习,初体验 ,对YII的一些理解.

    先说点没用的: 不会选择,选择后不坚持,不断的选择.这是人生中的一个死循环,前两一直迷茫.觉得自己前进方向很不明朗.想去学的东西有很多.想学好YII,想学PYTHON 想学学hadoop什么的,又想研 ...

  7. AndroidStudio初体验

    style="display: none;" frameborder="0"> 收藏成功 确定 收藏失败,请重新收藏 确定 查看所有私信查看所有通知 暂没 ...

  8. Cockroach数据库初体验

    结论前置 CR(笔者对cockroach的简称)数据库的产品体验比TIDB要好,例如官网.文档.部署维护.后台管理.监控,当然这里不是说tidb不好,tidb兼容mysql协议就非常棒,而且中文文档和 ...

  9. MapReduce编程初体验

    需求:在给定的文本文件中统计输出每一个单词出现的总次数 第一步: 准备一个aaa.txt文本文档 第二步: 在文本文档中随便写入一些测试数据,这里我写入的是 hello,world,hadoop he ...

最新文章

  1. javascript中的事件问题的总结
  2. Java Character 类
  3. Hybris (SAP旗下的软件公司)
  4. python三大结构、顺序结构_Python学习笔记3——三大结构:顺序,分支,循环3
  5. 面向对象编程的两顶帽子
  6. 苹果多款产品降价:iPhone XS系列降价500元 14天内可退差价
  7. 人工生命 2.0.1 版发布,给青蛙找个工作:走跷跷板
  8. 基于JAVA+SpringMVC+Mybatis+MYSQL的闲置物品交易平台
  9. IntelliJ Idea学习笔记004--- idea修改格式化代码快捷键_顺带一个激活地址_以及常用快捷键
  10. python信息安全书籍_信息安全从业者书单推荐
  11. linux 小红伞使用手册,安装LINUX下小红伞图文教程.pdf
  12. envi插件大津法_IDL处理Himawari8-NC数据
  13. Linux显示2015年日历表
  14. MT【217】韦达定理应用
  15. SptingBoot构建电商基础秒杀项目时遇到的问题
  16. 医院招聘护士 计算机证,医院招聘护士面试自我介绍
  17. opencv之伪彩变换
  18. sense8影评摘抄
  19. 饥荒开服(含各种踩雷)
  20. IT计算机前后端相关专业——20个常用的学习教程及在线编程工具

热门文章

  1. java 对Outlook保存的.Msg格式文件解析
  2. 国庆 深圳游玩 路线规划之南山区
  3. 计算机考试打字题遇到字母怎么办,手把手为你解决win10系统打字时莫名其妙出现字母的解决方法...
  4. 向量之间的内积和外积
  5. C++运算符重载(类内、外重载)
  6. K8S之taint\cordon\uncordon\drain使用案例——筑梦之路
  7. 车辆管理系统设计C++代码
  8. Django进阶教程
  9. transmission简单使用
  10. ucos II任务管理之三:删除任务