热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

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

一、前言二、概述三、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.cnf cp:是否覆盖"/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. OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE 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_installation which 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.pl Please 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!
推荐阅读
  • Python项目实战10.2:MySQL读写分离性能优化
    本文介绍了在Python项目实战中进行MySQL读写分离的性能优化,包括主从同步的配置和Django实现,以及在两台centos 7系统上安装和配置MySQL的步骤。同时还介绍了创建从数据库的用户和权限的方法。摘要长度为176字。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 本文主要介绍关于linux文件描述符设置,centos7设置文件句柄数,centos7查看进程数的知识点,对【Linux之进程数和句柄数】和【linux句柄数含义】有兴趣的朋友可以看下由【东城绝神】投 ... [详细]
  • Linux服务器密码过期策略、登录次数限制、私钥登录等配置方法
    本文介绍了在Linux服务器上进行密码过期策略、登录次数限制、私钥登录等配置的方法。通过修改配置文件中的参数,可以设置密码的有效期、最小间隔时间、最小长度,并在密码过期前进行提示。同时还介绍了如何进行公钥登录和修改默认账户用户名的操作。详细步骤和注意事项可参考本文内容。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • 本文介绍了在MacOS系统上安装MySQL的步骤,并详细说明了如何设置MySQL服务的开机启动和如何修改MySQL的密码。通过下载MySQL的macos版本并按照提示一步一步安装,在系统偏好设置中可以找到MySQL的图标进行设置。同时,还介绍了通过终端命令来修改MySQL的密码的具体操作步骤。 ... [详细]
  • 本文介绍了在CentOS 6.4系统中更新源地址的方法,包括备份现有源文件、下载163源、修改文件名、更新列表和系统,并提供了相应的命令。 ... [详细]
  • centos安装Mysql的方法及步骤详解
    本文介绍了centos安装Mysql的两种方式:rpm方式和绿色方式安装,详细介绍了安装所需的软件包以及安装过程中的注意事项,包括检查是否安装成功的方法。通过本文,读者可以了解到在centos系统上如何正确安装Mysql。 ... [详细]
  • Centos下安装memcached+memcached教程
    本文介绍了在Centos下安装memcached和使用memcached的教程,详细解释了memcached的工作原理,包括缓存数据和对象、减少数据库读取次数、提高网站速度等。同时,还对memcached的快速和高效率进行了解释,与传统的文件型数据库相比,memcached作为一个内存型数据库,具有更高的读取速度。 ... [详细]
  • 腾讯安全平台部招聘安全工程师和数据分析工程师
    腾讯安全平台部正在招聘安全工程师和数据分析工程师。安全工程师负责安全问题和安全事件的跟踪和分析,提供安全测试技术支持;数据分析工程师负责安全产品相关系统数据统计和分析挖掘,通过用户行为数据建模为业务决策提供参考。招聘要求包括熟悉渗透测试和常见安全工具原理,精通Web漏洞,熟练使用多门编程语言等。有相关工作经验和在安全站点发表作品的候选人优先考虑。 ... [详细]
  • PHP组合工具以及开发所需的工具
    本文介绍了PHP开发中常用的组合工具和开发所需的工具。对于数据分析软件,包括Excel、hihidata、SPSS、SAS、MARLAB、Eview以及各种BI与报表工具等。同时还介绍了PHP开发所需的PHP MySQL Apache集成环境,包括推荐的AppServ等版本。 ... [详细]
  • (九)Docker常用安装
    一、总体步骤1、搜索镜像2、拉取镜像3、查看镜像4、启动镜像5、停止镜像6、移除镜像二、安装tomcat1、dockerhub上面查找tomcat镜像 dockersearchto ... [详细]
  • 1、打开etcsysconfiggrub,   #vimetcsysconfiggrub   内容如下: ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
author-avatar
埼埼popo_514
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有