MySQL 5.5.32 配置文件优化详解

WBOY
Lepaskan: 2016-06-07 17:30:53
asal
1023 orang telah melayarinya

Mysql-5.5.32是Mysql5.5系列中最后一个版本,也是最后一个有配置文件的版本,为什么这么说呢,用过5.6的博友都知道,在mysql5.6中

大纲

一、配置文件说明

  • my-small.cnf

  • my-medium.cnf

  • my-large.cnf

  • my-huge.cnf

  • my-innodb-heavy-4G.cnf

  • 二、详解 my-innodb-heavy-4G.cnf

    三、配置文件优化

    注:环境说明,CentO5.5 x86_64+MySQL-5.5.32 相关软件。

    推荐阅读:

    详解MySQL配置的优化

    一、配置文件说明

    Mysql-5.5.32是Mysql5.5系列中最后一个版本,也是最后一个有配置文件的版本,为什么这么说呢,用过5.6的博友都知道,在mysql5.6中已经不提供配置文件选择,只有一个默认的配置文件,好了,我们今天说的是5.5.32这个版,就不和大家说5.6了,下面我们来具体说一下,mysql5.5.32中,提供可选的几个配置文件,

  • my-small.cnf

  • my-medium.cnf

  • my-large.cnf

  • my-huge.cnf

  • my-innodb-heavy-4G.cnf

  • 下面我们就来分别的看一下^_^……

    1.my-small.cnf

    1

    2

    3

    4

    5

    [root@mysql support-files]# vim my-small.cnf

    # Example MySQL config file for small systems.

    # This is for a system with little memory (

    # from time to time and it's important that the mysqld daemon

    # doesn't use much resources.

    这是my-small.cnf配置文件中开头的简介,它说明了,这个配置文件是在内存小于等于64M时使用的,小型数据库系统,目的是不占更多的系统资源!

    2.my-medium.cnf

    1

    2

    3

    4

    5

    [root@mysql support-files]# vim my-medium.cnf

    # Example MySQL config file for medium systems.

    # This is for a system with little memory (32M - 64M) where MySQL plays

    # an important part, or systems up to 128M where MySQL is used together with

    # other programs (such as a web server)

    这个配置文件是中型数据系统使用,内存在128M左右!

    3.my-large.cnf

    1

    2

    3

    4

    [root@mysql support-files]# vim my-large.cnf

    # Example MySQL config file for large systems.

    # This is for a large system with memory = 512M where the system runs mainly

    # MySQL.

    这个配置文件是大型数据库系统使用,内存在512M左右!

    4.my-huge.cnf

    1

    2

    3

    4

    [root@mysql support-files]# vim my-huge.cnf

    # Example MySQL config file for very large systems.

    # This is for a large system with memory of 1G-2G where the system runs mainly

    # MySQL.

    这个配置文件是巨型数据库系统使用,内存在1G-2G左右!

    5.my-innodb-heavy-4G.cnf

    1

    2

    3

    4

    5

    6

    7

    8

    [root@mysql support-files]# vim my-innodb-heavy-4G.cnf

    #BEGIN CONFIG INFO

    #DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries

    #TYPE: SYSTEM

    #END CONFIG INFO

    # This is a MySQL example config file for systems with 4GB of memory

    # running mostly MySQL using InnoDB only tables and performing complex

    # queries with few connections.

    这个配置文件主要作用是,支持4G内存,支持InnoDB引擎,支持事务(ACID)等特性所使用!

    说明:ACID,指数据库事务正确执行的四个基本要素的缩写。包含:原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)、持久性(Durability)!

    6.总结

    从上面的说明我们可以出,基本是通过内存大小来选择mysql的配置文件的,那有博友会说了,现在的服务器动不动就是32G内存或者64G内存,甚至更大的内存,你那个配置文件最大只支持4G内存是不是有点小了,确认会有这样的问题,mysql5.6以后,为了更大的发挥mysql的性能,已经去除了配置文件选择,只有一个默认的配置文件,里面只有一些基本配置,所有设置管理员都可以根据自己实际的需求进行自行设置,,好了说了这么多,我们就来说一说,在企业的用的最多的my-innodb-heavy-4G.cnf配置文件!

     

    linux

    sumber:php.cn
    Kenyataan Laman Web ini
    Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
    Tutorial Popular
    Lagi>
    Muat turun terkini
    Lagi>
    kesan web
    Kod sumber laman web
    Bahan laman web
    Templat hujung hadapan
    Tentang kita Penafian Sitemap
    Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!