zoukankan      html  css  js  c++  java
  • 存储引擎

     1、mysql可以将数据以不同的技术存储在文件(内存)中,这种技术就成为存储引擎。

    2、mysql支持的存储引擎

    --MyISAM(最常用,适用于事务的处理不多的情况)

    --InnoDB(适用于事务的处理比较多,需要有外键支持的情况

    --Memory

    --CSV 不支持索引

    --Archive

    3、并发控制:当多个连接对记录进行修改时保证数据的一致性和完整性。

    4、

    5、mysql设置存储引擎

    修改存储引擎的方法:

    (1)通过修改mysql配置文件实现:default-storage-engine = engine

    (2) 通过创建数据表命令实现

    CREATE TABLE table_name(

    ...

    ...

    )ENGINE = engine;

    mysql> CREATE TABLE tp1(
    -> s1 VARCHAR(10)
    -> )ENGINE = MyISAM;
    Query OK, 0 rows affected (0.05 sec)

    mysql> SHOW CREATE TABLE tp1;
    +-------+-----------------------------------------------------------------------
    --------------------+
    | Table | Create Table
    |
    +-------+-----------------------------------------------------------------------
    --------------------+
    | tp1 | CREATE TABLE `tp1` (
    `s1` varchar(10) DEFAULT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
    +-------+-----------------------------------------------------------------------
    --------------------+

    (3) 通过修改数据命令实现

    ALTER TABLE table_name ENGINE [=] engine_name;

    mysql> ALTER TABLE tp1 ENGINE = InnoDB;
    Query OK, 0 rows affected (0.19 sec)
    Records: 0 Duplicates: 0 Warnings: 0

    mysql> SHOW CREATE TABLE tp1;
    +-------+-----------------------------------------------------------------------
    --------------------+
    | Table | Create Table
    |
    +-------+-----------------------------------------------------------------------
    --------------------+
    | tp1 | CREATE TABLE `tp1` (
    `s1` varchar(10) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
    +-------+-----------------------------------------------------------------------
    --------------------+

    查看数据库的创建命令

    mysql> SHOW CREATE TABLE test;
    +-------+----------------------------------------------------------------------
    -------------------------------------------------------------------------------
    ---------------------------------------+
    | Table | Create Table

    |
    +-------+----------------------------------------------------------------------
    -------------------------------------------------------------------------------
    ---------------------------------------+
    | test | CREATE TABLE `test` (
    `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
    `username` varchar(20) DEFAULT NULL,
    PRIMARY KEY (`id`)
    ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 |
    +-------+----------------------------------------------------------------------
    -------------------------------------------------------------------------------
    ---------------------------------------+

    ENGINE=InnoDB为存储引擎

  • 相关阅读:
    论文笔记:SAIN: Self-Attentive Integration Network for Recommendation(SIGIR 2019)
    论文笔记:Neural Graph Collaborative Filtering(SIGIR 2019)
    已过的时间,未来的征程
    关于博客
    论文阅读:OpenFlow: Enabling Innovation in Campus Networks
    论文阅读:ClickNF: a Modular Stack for Custom Network Functions
    论文阅读:Forwarding Metamorphosis: Fast Programmable Match-Action Processing in Hardware for SDN
    论文阅读:Camdoop: Exploiting In-network Aggregation for Big Data Applications
    Hedera: Dynamic Flow Scheduling for Data Center Networks
    论文阅读:NETFPGA SUME: TOWARD 100 GBPS AS RESEARCH COMMODITY
  • 原文地址:https://www.cnblogs.com/toudoubao/p/6641169.html
Copyright © 2011-2022 走看看