- 浏览: 1898603 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
July01:
最近了解到一款StratoIO打印控件,功能如下:1、Html ...
jquery打印指定的div -
GentlemanQc:
...
quartz系列(二)spring3.2.5与quartz2.1.7集群版集成简要说明 -
静夜独窗:
你好,能说一下server.xml增加的配置是怎么影响性能的吗 ...
tomcat7.0性能优化-挑战极限精简版 -
beyondfengyu:
beyondfengyu 写道如果每个客户进程的时间不同步,时 ...
java并发(二十二)分布式锁 -
beyondfengyu:
如果每个客户进程的时间不同步,时间超前的进程是不是更容易得到锁 ...
java并发(二十二)分布式锁
官方网站
http://www.mysql.com/
下载
downloads(GA)--> MySQL Community Edition (GPL)
安装依赖
centos
yum install gcc gcc-c++ ncurses-devel zip make cmake
ubuntu
apt-get install gcc g++ cmake make libncurses5-dev bison zip
解压缩
tar -zxvf mysql-5.6.14.tar.gz
注意:
源码目录和安装目录不要使用同一目录!
清理环境
rm -rf /etc/my.cnf
userdel mysql
groupdel mysql
安装mysql
cmake -DCMAKE_INSTALL_PREFIX=/application/search/mysql/mysql-5.6.14 \
-DMYSQL_DATADIR=/data0/search/mysql/data \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1
注:如果想重新cmake,则需要删除目录下的 rm -rf CMakeCache.txt
make -j16 && make install -j16
=====================================================
修改配置文件 /application/search/mysql/mysql-5.6.14/tmp/my.cnf
配置文件是5.5和5.6最关键的区别
=====================================================
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
# 用户客户端bin目录下直接登录使用
[client]
port = 3306
socket = /application/search/mysql/mysql-5.6.14/tmp/mysql.sock
[mysql]
default-character-set=utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 1024M
innodb_data_file_path = ibdata1:64M:autoextend
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 0
innodb_use_sys_malloc = 0
# Additional memory pool that is used by InnoDB to store metadata
# information. If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS. As this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size = 16M
# If you run into InnoDB tablespace corruption, setting this to a nonzero
# value will likely help you to dump your tables. Start from value 1 and
# increase it until you're able to dump the table successfully.
#innodb_force_recovery=1
# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency = 16
# Set this option if you would like the InnoDB tablespace files to be
# stored in another location. By default this is the MySQL datadir.
#innodb_data_home_dir = <directory>
# Number of IO threads to use for async IO operations. This value is
# hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
# larger number.
innodb_write_io_threads = 8
innodb_read_io_threads = 8
#去掉警告 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.Please use --explicit_defaults_for_timestamp server option (seedocumentation for more details).
explicit_defaults_for_timestamp = true
# These are commonly set, remove the # and set as required.
basedir = /application/search/mysql/mysql-5.6.14
datadir = /data0/search/mysql/data
port = 3306
server_id = 1
socket = /application/search/mysql/mysql-5.6.14/tmp/mysql.sock
pid-file=/application/search/mysql/mysql-5.6.14/tmp/mysqld.pid
log-bin=/data0/search/mysql/log/mysql-bin
relay_log=/data0/search/mysql/log/mysql-relay-bin
log-error=/data0/search/mysql/log/mysqld.err
character-set-server=utf8
default-storage-engine=INNODB
skip-host-cache
skip-name-resolve
innodb_file_per_table=1
expire_logs_days = 10
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
==========================================
手工创建目录,不创建会报错
mkdir -p /data0/search/mysql/data
mkdir -p /data0/search/mysql/log
初始化mysql数据文件及日志文件
cd /application/search/mysql/mysql-5.6.14/scripts
./mysql_install_db --basedir=/application/search/mysql/mysql-5.6.14 --datadir=/data0/search/mysql/data --user=search --defaults-file=/application/search/mysql/mysql-5.6.14/tmp/my.cnf
安装完之后,会提示
New default config file was created as /root/usr/mysql/mysql-5.6.14/my.cnf and will be used by default by the server when you start it.You may edit this file to change server settings
${mysql_home}下的my.cnf会作为默认的配置文件使用
因此我们需要删除${mysql_home}/my.cnf
然后在mysql/bin/mysql --help的时候可以看到一句话
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /root/usr/mysql/mysql-5.6.14/etc/my.cnf ~/.my.cnf
因此我们放到
${mysql_home}/etc/my.cnf
位置是理想的
启动脚本/application/search/mysql/mysql-5.6.14/support-files/mysql.server需要修改才可以使用
非mysql账户启动,参考http://blog.csdn.net/liuguxing/article/details/8835330
因为mysqld_safe启动时默认用的用户是mysql,而脚本中没有指定--user,所以可自行修改脚本,在mysqld_safe命令处(在5.6.14中是第283行)加上参数:--user=root
cd /application/search/mysql/mysql-5.6.14/support-files
cp mysql.server ../mysql.server
起停一 ${mysql_home}/bin命令
./bin/mysqld -uroot &
./bin/mysqladmin shutdown -uroot
起停二 使用脚本${mysql_home}/support-files/mysql.server
sh mysql.server start
sh mysql.server stop
附录
安装 cmake http://phl.iteye.com/blog/1974496
http://www.mysql.com/
下载
downloads(GA)--> MySQL Community Edition (GPL)
安装依赖
centos
yum install gcc gcc-c++ ncurses-devel zip make cmake
ubuntu
apt-get install gcc g++ cmake make libncurses5-dev bison zip
解压缩
tar -zxvf mysql-5.6.14.tar.gz
注意:
源码目录和安装目录不要使用同一目录!
清理环境
rm -rf /etc/my.cnf
userdel mysql
groupdel mysql
安装mysql
cmake -DCMAKE_INSTALL_PREFIX=/application/search/mysql/mysql-5.6.14 \
-DMYSQL_DATADIR=/data0/search/mysql/data \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1
注:如果想重新cmake,则需要删除目录下的 rm -rf CMakeCache.txt
make -j16 && make install -j16
=====================================================
修改配置文件 /application/search/mysql/mysql-5.6.14/tmp/my.cnf
配置文件是5.5和5.6最关键的区别
=====================================================
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
# 用户客户端bin目录下直接登录使用
[client]
port = 3306
socket = /application/search/mysql/mysql-5.6.14/tmp/mysql.sock
[mysql]
default-character-set=utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 1024M
innodb_data_file_path = ibdata1:64M:autoextend
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 0
innodb_use_sys_malloc = 0
# Additional memory pool that is used by InnoDB to store metadata
# information. If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS. As this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size = 16M
# If you run into InnoDB tablespace corruption, setting this to a nonzero
# value will likely help you to dump your tables. Start from value 1 and
# increase it until you're able to dump the table successfully.
#innodb_force_recovery=1
# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency = 16
# Set this option if you would like the InnoDB tablespace files to be
# stored in another location. By default this is the MySQL datadir.
#innodb_data_home_dir = <directory>
# Number of IO threads to use for async IO operations. This value is
# hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
# larger number.
innodb_write_io_threads = 8
innodb_read_io_threads = 8
#去掉警告 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.Please use --explicit_defaults_for_timestamp server option (seedocumentation for more details).
explicit_defaults_for_timestamp = true
# These are commonly set, remove the # and set as required.
basedir = /application/search/mysql/mysql-5.6.14
datadir = /data0/search/mysql/data
port = 3306
server_id = 1
socket = /application/search/mysql/mysql-5.6.14/tmp/mysql.sock
pid-file=/application/search/mysql/mysql-5.6.14/tmp/mysqld.pid
log-bin=/data0/search/mysql/log/mysql-bin
relay_log=/data0/search/mysql/log/mysql-relay-bin
log-error=/data0/search/mysql/log/mysqld.err
character-set-server=utf8
default-storage-engine=INNODB
skip-host-cache
skip-name-resolve
innodb_file_per_table=1
expire_logs_days = 10
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
==========================================
手工创建目录,不创建会报错
mkdir -p /data0/search/mysql/data
mkdir -p /data0/search/mysql/log
初始化mysql数据文件及日志文件
cd /application/search/mysql/mysql-5.6.14/scripts
./mysql_install_db --basedir=/application/search/mysql/mysql-5.6.14 --datadir=/data0/search/mysql/data --user=search --defaults-file=/application/search/mysql/mysql-5.6.14/tmp/my.cnf
安装完之后,会提示
New default config file was created as /root/usr/mysql/mysql-5.6.14/my.cnf and will be used by default by the server when you start it.You may edit this file to change server settings
${mysql_home}下的my.cnf会作为默认的配置文件使用
因此我们需要删除${mysql_home}/my.cnf
然后在mysql/bin/mysql --help的时候可以看到一句话
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /root/usr/mysql/mysql-5.6.14/etc/my.cnf ~/.my.cnf
因此我们放到
${mysql_home}/etc/my.cnf
位置是理想的
启动脚本/application/search/mysql/mysql-5.6.14/support-files/mysql.server需要修改才可以使用
非mysql账户启动,参考http://blog.csdn.net/liuguxing/article/details/8835330
因为mysqld_safe启动时默认用的用户是mysql,而脚本中没有指定--user,所以可自行修改脚本,在mysqld_safe命令处(在5.6.14中是第283行)加上参数:--user=root
cd /application/search/mysql/mysql-5.6.14/support-files
cp mysql.server ../mysql.server
起停一 ${mysql_home}/bin命令
./bin/mysqld -uroot &
./bin/mysqladmin shutdown -uroot
起停二 使用脚本${mysql_home}/support-files/mysql.server
sh mysql.server start
sh mysql.server stop
附录
安装 cmake http://phl.iteye.com/blog/1974496
发表评论
-
MySQL主从复制讨论纪要
2016-02-09 21:40 1675读了一篇技术文章,和架构部的全体兄弟们进行了讨论。 以下为讨论 ... -
MYSQL使用心得(十二)----主从复制指定二进制日志位置
2013-12-11 19:25 4530相关命令 show slave status \G的具体含义 ... -
MYSQL使用心得(十一)----按日期进行表分区
2013-12-01 23:03 5775创建 create table user (id int(11 ... -
MYSQL使用心得(十)----常用命令
2013-12-01 09:04 1998mysql查看状态 ./mysqladmin ... -
MYSQL使用心得(九)----联合索引
2013-11-30 00:18 1576注意:Index(Name,Age)表示在Name,Age两列 ... -
MYSQL使用心得(八)----在线主从复制集群的配置与恢复及主主配置
2013-11-30 00:08 2226在线执行主从配置 步骤 1.锁表 FLUSH TABLES W ... -
MYSQL使用心得(七)----读写分离集群方案之haproxy+keepalived+abstractRoutingDataSource
2013-11-29 23:33 7293在公司做mysql集群方案的时候,经过多次的分析与讨论,以及性 ... -
MYSQL使用心得(六)----cluster
2013-11-29 09:15 2222官方网站 http://dev.mysql.com/downl ... -
MYSQL集群介绍
2013-11-28 22:55 2077mysql-proxy MySQL Proxy是一个处于你的c ... -
mysql读写分离高级驱动
2013-11-25 09:58 1156负载均衡 http://dev.mysql.com/doc/r ... -
MySQL乱码处理
2013-11-25 09:50 7421。过滤器 2。头文件 3。MySQL数据库的 my.ini文 ... -
mysql日期函数
2013-11-25 09:48 752对于每个类型拥有的值范围以及并且指定日期何时间值的有效格式的描 ... -
MYSQL使用心得(二)----主从复制
2013-11-25 09:30 1645基本配置 主数据库 配置文件,修改server_id=1 建立 ... -
cmake的安装
2013-11-13 22:51 1340安装mysql5.5和5.6的时候,需要使用cmake编译,所 ... -
MYSQL使用心得(三)----性能与管理优化
2013-03-01 22:36 6996基于 /application/search/mysql/my ... -
MYSQL使用心得(五)----InnoDB与MyISAM
2012-11-08 21:31 1610本文主要整理了Mysql 两 ... -
MySQL基础----彻底解决phpMyAdmin安装问题
2011-02-11 12:27 3068一 环境 httpd-2.2.17-win32-x86-no_ ... -
centOS or ubuntu下安装mysql5.5
2010-12-31 16:10 3079依赖库 ubuntu apt-get install gcc ... -
MYSQL使用心得(四)----临时表与内存表
2010-12-19 14:43 3469mysql5.5性能优化-内存表 内存表分为2种,但共同点是, ... -
Mysql 5.5 无法远程登陆:Can't get hostname for your address
2010-12-17 13:06 6057昨天oracle刚发布了MySQL5.5.8和5.1.54,欣 ...
相关推荐
MySQL 5.6.50 是一个非常稳定且广泛使用的数据库管理系统版本,它在数据库社区中享有很高的声誉。本文将详细介绍如何使用提供的安装资源包进行MySQL 5.6.50的编译安装过程,以及在这个过程中可能遇到的关键知识点。 ...
在Ubuntu系统中安装MySQL 5.6涉及到一系列步骤,这里我们将详细讲解如何通过二进制方式来完成安装。首先,我们需要下载MySQL的二进制包,然后创建必要的目录和用户,配置系统文件,安装依赖,初始化数据库,设置环境...
本文将详细讨论MySQL 5.7.32版本在不同架构下的安装文件,特别是针对ARM架构的glibc 2.28环境。 首先,我们关注的是`mysql-5.7.32-linux-glibc-2.28-aarch64.tar.gz`这个文件。这个文件是专门为基于ARM架构...
在CentOS7操作系统中安装MySQL数据库管理系统是一项关键任务,尤其对于需要进行数据库管理的服务器环境。MySQL是一个流行的开源关系型数据库管理系统,它提供了稳定性和高效性能。本文将详细阐述源码安装MySQL的五个...
本文将详细介绍如何在Linux环境下安装和配置MySQL 5.6.29版本,包括RPM包的安装、服务器和客户端的设置以及开发库的使用。 一、RPM包介绍 RPM(Red Hat Package Manager)是Linux系统中常见的软件包管理工具,用于...
本实践教程将带你一步步完成这个过程,确保你能够在本地环境中成功安装MySQL 5.6。首先,我们需要准备必要的工具和资源。 1. **环境准备**: - Linux5:这是你的操作系统,可能是基于Red Hat或Debian的发行版,...
你需要一个支持的操作系统(如Ubuntu、CentOS或Windows),足够的内存(至少512MB,推荐1GB以上),以及足够的硬盘空间。 三、安装步骤 1. **下载MySQL 5.6安装包**:首先,你需要从MySQL官方网站下载适合你系统的...
这个"mysql-5.6.38-linux-64bit"压缩包文件是为Linux操作系统(可能是Ubuntu, CentOS, Red Hat等)的64位架构设计的MySQL 5.6.38版本。MySQL 5.6是MySQL的一个重要版本,它包含了许多性能提升、功能增强以及稳定性...
MySQL DBA在Windows和Linux环境下安装MySQL5.7和5.6版本的步骤涉及多个环节,包括环境准备、软件下载与安装、启动服务、用户管理以及远程访问设置。以下是详细的安装指南: 1. **前言** 在进行MySQL安装之前,确保...
这个文件用于在基于RPM的系统(如CentOS或Red Hat Enterprise Linux 6)上安装MySQL服务器。 2. MySQL-client-5.6.35-1.el6.x86_64.rpm:这是MySQL客户端的RPM包,用于在相同的系统上安装MySQL命令行客户端和其他...
"MySQL 5.6 for Windows 解压缩版配置安装.docx"可能提供了Windows下的详细过程,但在Linux中,配置文件通常位于`/etc/mysql/my.cnf`。你可以在这里调整各种参数,比如修改默认字符集、优化性能设置、设置服务器端口...
1. 安装Linux操作系统,如Ubuntu或CentOS。 2. 更新系统并安装必要的编译工具和依赖库。 3. 下载并编译安装Nginx、MySQL、PHP7.1、Yaf和Redis的源码。 4. 配置Nginx以支持PHP处理,通过fastcgi_pass指令连接到...
Ubuntu 用户可以采用类似的方法来安装 PXC,主要步骤包括系统准备、安装依赖、下载安装包、安装配置和验证安装。 ##### 5.3 如何在同一台服务器上设置 3 节点集群 在单台服务器上设置 3 节点集群是一种常见的测试和...
在某些Linux发行版中,如CentOS或Ubuntu,安全增强型Linux (SELinux) 或 AppArmor 可能会限制MySQL服务的网络访问。检查这些安全模块的策略设置,确保它们允许MySQL服务的网络通信。 5. **重启动MySQL服务**: ...
这个过程适用于大多数基于Linux的系统,如CentOS、Ubuntu等。请注意,如果你的系统配置或MySQL版本不同,某些步骤可能会略有差异。务必根据实际环境进行调整。如果遇到问题,可以参考相关文章找到适合你情况的解决...
(Linux、Nginx/Tengine/OpenResty、生产环境下MySQL/MariaDB/Percona、PHP、JAVA),适用于CentOS 6 ~ 7(包括 redhat)、Debian 6 ~ 9、Ubuntu 12 ~ 18、Fedora 27~28 的 32 和 64。 脚本属性: 持续更新,提供...
(Linux、Nginx/Tengine/OpenResty、生产环境下MySQL/MariaDB/Percona、PHP、JAVA),适用于CentOS 6 ~ 7(包括 redhat)、Debian 6 ~ 9、Ubuntu 12 ~ 18、Fedora 27~28 的 32 和 64。 脚本属性: 持续更新,提供...
【MySQL在Linux环境下的安装与配置】 MySQL是一种广泛使用的开源关系型数据库管理系统(RDBMS),在Linux系统中尤其受欢迎,因为Linux与MySQL的开源性质相得益彰。本压缩包"LinuxAndMySQL.zip"包含了MySQL的两个...
综上所述,"php7mysql插件"在CentOS上的安装和使用是LAMP环境中一个基本但至关重要的步骤,它连接了PHP应用和MySQL数据库,使得数据的存取成为可能。了解和掌握这些知识对于任何在Linux服务器上构建Web应用的人来说...