当前位置:网站首页>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
边栏推荐
- Parker Parker sensor p8s-grflx
- Servlet operation principle_ API details_ Advanced path of request response construction (servlet_2)
- vue3 响应式数据库—— reactive
- Animesr: learnable degradation operator and new real world animation VSR dataset
- Analysis on the construction scheme and necessity of constructing expressway video monitoring platform
- New research of HKUST & MsrA: about image to image conversion, finishing is all you need
- 知名互联网房屋租赁服务公司物联网关键业务迁移上云实践
- What will be the game changes brought about by the meta universe?
- Spin lock exploration
- EMQ helps Qingdao Yanbo build a smart water platform
猜你喜欢

MOOG servo valve d661-4577c

Develop those things: how to add text watermarks to videos?

水平视觉错误效果js特效代码

5g has been in business for three years. Where will innovation go in the future?

DeFi借贷协议机制对比:Euler、Compound、Aave和Rari Capital

Small Tools(3) 集成Knife4j3.0.3接口文档

Spin lock exploration

Write the simplest small program in C language Hello World

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

Thinking on large file processing (upload, download)
随机推荐
New skill: accelerate node through code cache JS startup
【架构】1366- 如何画出一张优秀的架构图
Hyper-V: enable SR-IOV in virtual network
MSF后渗透总结
Distributed machine learning: model average Ma and elastic average easgd (pyspark)
Animesr: learnable degradation operator and new real world animation VSR dataset
Word中添加代码块(转载)
Do fresh students get a job or choose a job after graduation?
Booking UI effect implemented by svg
canvas云朵形状动画
Parker Parker sensor p8s-grflx
Implementation of graduation project management system based on SSM
JS from prototype chain to inheritance
IEEE TBD SCI影响因子提升至4.271,位列Q1区!
Canvas mouse control gravity JS effect
Share 5 commonly used feature selection methods, and you must see them when you get started with machine learning!!!
The new version of Shangding cloud | favorites function has been launched to meet personal use needs
Exch:修复丢失的系统邮箱
New power of data analysis -- the first open source integrated real-time HTAP database in China was released by stonedb
现在玩期货需要注意什么,在哪里开户比较安全,我第一次接触