MySQL5.1 MyISAM与InnoDB 引擎读写性能对比

一、前言二、概述三、100万数据性能测试四、200万数据性能测试五、500万数据性能测试六、1000万数据性能测试七、总结注,测试环境CentOS6.4x86_64,软件版本MySQ

二、概述

1.环境准备

(1).安装yum源

[root@node6 src]# wget [root@node6 src]# rpm -ivh epel-release-6-8.noarch.rpm

(2).同步时间(系统与硬件)

[root@node6 src]# yum install -y ntp[root@node6 src]# ntpdate 202.120.2.101[root@node6 src]# hwclock -w

2.安装mysql 5.1

[root@node6 mysql-5.1.73]# tar xf mysql-5.1.73.tar.gz[root@node6 mysql-5.1.73]# cd mysql-5.1.73[root@node6 mysql-5.1.73]# ./configure –prefix=/usr/local/mysql –localstatedir=/data/mysql –enable-assembler –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static –with-pthread –enable-static –with-big-tables –without-ndb-debug –with-charset=utf8 –with-extra-charsets=all –without-debug –enable-thread-safe-client –enable-local-infile –with-plugins=max

出错1:checking for termcap functions library… configure: error: No curses/termcap library found。

原因:缺少ncurses安装包。

解决方法,

[root@node6 mysql-5.1.73]# yum -y install ncurses ncurses-devel

下面继续,

[root@node6 mysql-5.1.73]# ./configure –prefix=/usr/local/mysql –localstatedir=/data/mysql –enable-assembler –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static –with-pthread –enable-static –with-big-tables –without-ndb-debug –with-charset=utf8 –with-extra-charsets=all –without-debug –enable-thread-safe-client –enable-local-infile –with-plugins=max

上面配置内容省略……

This version of MySQL Cluster is no longer maintained. Please use the separate sources provided for MySQL Cluster instead. See for more details.Thank you for choosing MySQL!Remember to check the platform specific part of the reference manual for hints about installing MySQL on your platform. Also have a look at the files in the Docs directory.

到这里我们编译配置就完成了,下面我们编译并安装。

[root@node6 mysql-5.1.73]# make && make install

注,编译与安装时间比较长请大家耐心等待,当然会看各位博友机器的配置,相对来说配置越好,相对的编译与安装时间相对就少。

3.创建数据目录并授权

[root@node6 mysql-5.1.73]# mkdir -pv /data/mysql mkdir: 已创建目录 “/data/mysql” [root@node6 mysql-5.1.73]# useradd mysql [root@node6 mysql-5.1.73]# chown mysql.mysql /data/mysql/ [root@node6 mysql-5.1.73]# ll /data/ 总用量 20 drwx——. 2 root root 16384 8月 17 18:42 lost+found drwxr-xr-x. 2 mysql mysql 4096 1月 4 16:10 mysql

4.为mysql提供配置文件

[root@node6 mysql-5.1.73]# cp support-files/my-huge.cnf /etc/my.cnfcp:是否覆盖”/etc/my.cnf”? y

5.简单修改一下配置文件

[root@node6 mysql-5.1.73]# vim /etc/my.cnf[client]default-character-set = utf8[mysqld] default-character-set = utf8 datadir= /data/mysql

6.提供启动脚本

[root@node6 mysql-5.1.73]# cp support-files/mysql.server /etc/init.d/mysqld [root@node6 mysql-5.1.73]# chmod +x /etc/init.d/mysqld[root@node6 ~]# chkconfig mysqld –add [root@node6 ~]# chkconfig mysqld on

7.初始化mysql

[root@node6 mysql-5.1.73]# /usr/local/mysql/bin/mysql_install_db –basedir=/usr/local/mysql/ –datadir=/data/mysql/ –user=mysql Installing MySQL system tables… 140104 16:18:43 [Warning] ‘–default-character-set’ is deprecated and will be removed in a future release. Please use ‘–character-set-server’ instead. 140104 16:18:43 [Warning] ‘–skip-locking’ is deprecated and will be removed in a future release. Please use ‘–skip-external-locking’ instead. OK Filling help tables… 140104 16:18:43 [Warning] ‘–default-character-set’ is deprecated and will be removed in a future release. Please use ‘–character-set-server’ instead. 140104 16:18:43 [Warning] ‘–skip-locking’ is deprecated and will be removed in a future release. Please use ‘–skip-external-locking’ instead. OKTo start mysqld at boot time you have to copy support-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands:/usr/local/mysql//bin/mysqladmin -u root password ‘new-password’ /usr/local/mysql//bin/mysqladmin -u root -h node6.test.com password ‘new-password’Alternatively you can run: /usr/local/mysql//bin/mysql_secure_installationwhich will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with: cd /usr/local/mysql/ ; /usr/local/mysql//bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.pl cd /usr/local/mysql//mysql-test ; perl mysql-test-run.plPlease report any problems with the /usr/local/mysql//scripts/mysqlbug script!

注,从上面的内容中我们看到了几个警告,我们查看一下。

140104 16:18:43 [Warning] ‘–default-character-set’ is deprecated and will be removed in a future release. Please use ‘–character-set-server’ instead. 140104 16:18:43 [Warning] ‘–skip-locking’ is deprecated and will be removed in a future release. Please use ‘–skip-external-locking’ instead. OK Filling help tables… 140104 16:18:43 [Warning] ‘–default-character-set’ is deprecated and will be removed in a future release. Please use ‘–character-set-server’ instead. 140104 16:18:43 [Warning] ‘–skip-locking’ is deprecated and will be removed in a future release. Please use ‘–skip-external-locking’ instead.

从上面的警告可以看到,–default-character-set、–skip-locking选项已经过时,建议使用–character-set-server、–skip-external-locking。

8.查看一下初始化目录

[root@node6 data]# ls /data/mysql/ mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.index test

9.启动一下mysql

[root@node6 ~]# service mysqld start Starting MySQL.. SUCCESS!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/1866888.html

(0)
上一篇 2025年2月22日 07:32:17
下一篇 2025年2月22日 07:32:33

AD推荐 黄金广告位招租... 更多推荐

相关推荐

  • MySQL 5.6之innodb导入的改进

    在MySQL 5.6之前,导入单个innodb表的idb文件需要对齐tablespace id,而如果tablespace id不一致,就需要通过在新库不挺的新建表 在mysql 5.6之前,导入单个innodb表的idb文件需要对齐tab…

    数据库 2025年2月23日
    100
  • InnoDB: Error: io_setup() failed with EAGAIN after 5 attempt

    在一台服务器中以各数据库的备份文件为数据文件启动多个MySQL实例供SQL Review使用。之前运行一直没有问题(最多的时候有23个MyS 在一台服务器中以各数据库的备份文件为数据文件启动多个mysql实例供sql review使用。之前…

    数据库 2025年2月23日
    100
  • InnoDB与Oracle单行存储长度对比

    众所周知,MySQL InnoDB存储引擎与Oracle非常相似,支持事务,row-locking,经过实际测试,innodb与oracle一个比较大的差异点为,相 众所周知,MySQL InnoDB存储引擎与Oracle非常相似,支持事务…

    数据库 2025年2月23日
    100
  • 为MySQL数据库的InnoDB引擎配置裸设备(Raw Device)

    MySQL 的 InnoDB 存储引擎不仅可以缓存索引,而且还可以缓存数据,如果将其表和索引存储在裸设备(Raw Device)上,从而绕过了文件 mysql 的 innodb 存储引擎不仅可以缓存索引,而且还可以缓存数据,如果将其表和索引…

    数据库 2025年2月22日
    100
  • 一个InnoDB 加锁的案例

    最近一直在优化各个产品的SQL语句,同时还帮一个同事解决deadlock问题,收获就是对InnoDB加锁的理解更加深入了。先来看看今天的这 最近一直在优化各个产品的sql语句,同时还帮一个同事解决deadlock问题,收获就是对innodb…

    数据库 2025年2月22日
    100
  • 工作中InnoDB引擎数据库主从复制同步心得

    近期将公司的MySQL架构升级了,由原先的一主多从换成了DRBD+Heartbeat双主多从,正好手上有一个电子商务网站新项目也要上线了,用 近期将公司的mysql架构升级了,由原先的一主多从换成了drbd+heartbeat双主多从,正好…

    数据库 2025年2月22日
    100
  • InnoDB 中foreign key使用注意事项

    在 sel statement 中的inserts,deletes,updates 很多行的时候,fk 会一行一行检查。 innodb是设置 shared row_level locks 在父表 innodb foreign key 和 s…

    数据库 2025年2月22日
    100
  • MySQL的MyISAM引擎不支持事务

    找一天的 spring 事务回滚错误,终于找到了 原来 MySQL的MyISAM引擎,是不支持事务处理的 唉~~~ 看看mysql 用少了 找一天的 spring 事务回滚错误,终于找到了  原来 mysql的myisam引擎 是不支持事务…

    数据库 2025年2月22日
    100
  • innodb中的REDO解析

    INNODB存储引擎的预写日志方式来保证事务的完整性。这意味着磁盘上的存储的数据页和内存缓冲池中的页是不同步的,对于内粗缓冲中 在innodb存储引擎中,事务日志通过重做(redo)日志文件和innodb存储引擎的日志缓冲(innodb l…

    数据库 2025年2月22日
    100
  • MySQL 5.1安装InnoDB引擎

    安装 innodb 引擎(mysql5.1默认不安装),可以在编译安装时,在configrue的时候,加上–with-plugins=innobase这个参数。如果之 安装 innodb 引擎(mysql5.1默认不安装) 可以…

    数据库 2025年2月22日
    100

发表回复

登录后才能评论