Giter Club home page Giter Club logo

transaction-test's Introduction

事务学习

创建数据库

CREATE DATABASE `transaction_test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */

-- 默认表为 innodb 存储引擎
-- auto-generated definition
create table userinfo
(
    id       int auto_increment   primary key,
    username varchar(32)          not null,
    nickname varchar(32)          not null,
    password varchar(32)          not null,
    status   tinyint(1) default 1 not null
) comment '用户信息表';

create table userinfo_myisam
(
    id       int auto_increment   primary key,
    username varchar(32)          not null,
    nickname varchar(32)          not null,
    password varchar(32)          not null,
    status   tinyint(1) default 1 not null
) engine=MyISAM comment '用户信息表-MYISAM引擎';

查看数据库的存储引擎

show variables like '%storage_engine%';
-- default_storage_engine,InnoDB
-- default_tmp_storage_engine,InnoDB
-- disabled_storage_engines,""
-- internal_tmp_mem_storage_engine,TempTable

-- 查询innodb引擎状态
show engine innodb status;

设置命令行的隔离级别(SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED)

set transaction isolation level READ UNCOMMITTED; 

查看默认事务隔离级别

show variables like 'transaction_isolation';
-- transaction_isolation,REPEATABLE-READ

transaction-test's People

Contributors

ahern88 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.