当前位置:网站首页>Several points in MySQL that are easy to ignore and forget
Several points in MySQL that are easy to ignore and forget
2022-06-30 17:59:00 【The disease has turned yellow】
MySQL
Backup and recovery
Database backup :
The graphical interface is often easy to forget how to write commands after a long time
dos Enter... Under the window
mysqldump -u root -p -B databaseName1 [databaseName2 databaseNamen] > d:\\bak.sql
Table backup
mysqldump -u root -p databaseName tableName1 [tableName2 tableNamen] > d:\\bak.sql
recovery
mysql Input in
source d:\\bak.sql;
Common data types
varchar
Range 0-65535 byte Maximum 65532 byte (1~3 Bytes are used to record the size )
If the table code is utf8 varchar(size) size = (65535 - 3) / 3 = 21844
If the table code is gbk varchar(size) size = (65535 - 3) / 2 = 32766
That is, the maximum number of characters that can be specified when creating a table is the above two
char(4) and varchar(4) It means the character , Not bytes , There are four characters in both numbers and Chinese characters , The byte space occupied depends on the encoding .
timestamp
You can create a table with a statement If this field does not specify a value during creation and update, the current timestamp is used .
NOT NULL
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP;
CRUD
count(*) And count( Column ) difference
- count(*): Return the number of rows of records that meet the conditions
- count( Column ) The statistical conditions of , How many in a column , But it will be ruled out null
Business
View the isolation level of the current session
SELECT @@tx_isolation;
View the current isolation level of the system
SELECT @@global.tx_isolation;
Set the isolation level of the current session
SET SESSION TRANSACTION ISOLATION LEVEL read uncommitted -- It can be followed by four isolation levels for example READ UNCOMMITTED
Set the current isolation level of the system
SET GLOBAL TRANSACTION ISOLATION LEVEL read uncommitted -- It can be followed by four isolation levels for example READ UNCOMMITTED
Global modification , stay my.ini Profile's [mysqld] Add or modify
# The equal sign is followed by four isolation levels for example READ UNCOMMITTED
transaction-isolation = read uncommitted
The transaction ACID characteristic
- Atomicity (Atomicity)
A transaction is an indivisible unit of work , Either the operations in the transaction occur , Or none at all .
- Uniformity (Consistency)
Transactions must transform the database from one consistent state to another .
- Isolation, (Isolation)
Transaction isolation is when multiple users access the database concurrently , A transaction opened by a database for each user , Can't be disturbed by the operation data of other transactions , Multiple concurrent transactions should be isolated from each other .
- persistence (Durability)
Once a transaction is committed , Its changes to database data are permanent , Next, even if the database fails, it should not have any impact .
Storage engine
Modify the storage engine
ALTER TABLE `tablename` ENGINE = innodb -- For example, it needs to be changed to innodb
边栏推荐
- Apache 解析漏洞(CVE-2017-15715)_漏洞复现
- [C language] explain threads - start two threads
- 【义修换届大礼包】
- [machine learning] K-means clustering analysis
- Design and principle of tubes responsive data system
- Parker variable displacement piston pump pv092r1k1t1nmmc
- What did Tongji and Ali study in the CVPR 2022 best student thesis award? This is an interpretation of yizuo
- 【剑指Offer】52. 两个链表的第一个公共节点
- What will be the game changes brought about by the meta universe?
- 元宇宙带来的游戏变革会是怎样的?
猜你喜欢

How to write a technical proposal

港科大&MSRA新研究:关于图像到图像转换,Finetuning is all you need

每日面试1题-蓝队基础面试题-应急响应(1)应急响应基本思路流程+Windows入侵排查思路

Animesr: learnable degradation operator and new real world animation VSR dataset
![Ten thousand volumes - list sorting [01]](/img/d4/124101b919a4d8163a32fc0f158efa.png)
Ten thousand volumes - list sorting [01]

MOOG servo valve d661-4577c

Six pictures show you why TCP has three handshakes?

New skill: accelerate node through code cache JS startup

MIT科技评论2022年35岁以下创新者名单发布,含AlphaFold作者等

svg实现的订票UI效果
随机推荐
【义修换届大礼包】
Word中添加代码块(转载)
In the past, the industrial Internet we knew only appeared as a substitute for the consumer Internet
Map collection
MSF后渗透总结
Do fresh students get a job or choose a job after graduation?
Acwing game 57
知名互联网房屋租赁服务公司物联网关键业务迁移上云实践
现在玩期货需要注意什么,在哪里开户比较安全,我第一次接触
Send the injured baby for emergency medical treatment. Didi's driver ran five red lights in a row
编译生成busybox文件系统
Vue3 reactive database
Small Tools(3) 集成Knife4j3.0.3接口文档
Distributed machine learning: model average Ma and elastic average easgd (pyspark)
New skill: accelerate node through code cache JS startup
构建基本buildroot文件系统
港科大&MSRA新研究:关于图像到图像转换,Finetuning is all you need
Inventory in the first half of 2022: summary of major updates and technical points of 20+ mainstream databases
5g business is officially commercial. What are the opportunities for radio and television?
水平视觉错误效果js特效代码