- 浏览: 1869850 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
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 1610读了一篇技术文章,和架构部的全体兄弟们进行了讨论。 以下为讨论 ... -
MYSQL使用心得(十二)----主从复制指定二进制日志位置
2013-12-11 19:25 4485相关命令 show slave status \G的具体含义 ... -
MYSQL使用心得(十一)----按日期进行表分区
2013-12-01 23:03 5714创建 create table user (id int(11 ... -
MYSQL使用心得(十)----常用命令
2013-12-01 09:04 1941mysql查看状态 ./mysqladmin ... -
MYSQL使用心得(九)----联合索引
2013-11-30 00:18 1540注意:Index(Name,Age)表示在Name,Age两列 ... -
MYSQL使用心得(八)----在线主从复制集群的配置与恢复及主主配置
2013-11-30 00:08 2175在线执行主从配置 步骤 1.锁表 FLUSH TABLES W ... -
MYSQL使用心得(七)----读写分离集群方案之haproxy+keepalived+abstractRoutingDataSource
2013-11-29 23:33 7185在公司做mysql集群方案的时候,经过多次的分析与讨论,以及性 ... -
MYSQL使用心得(六)----cluster
2013-11-29 09:15 2169官方网站 http://dev.mysql.com/downl ... -
MYSQL集群介绍
2013-11-28 22:55 2008mysql-proxy MySQL Proxy是一个处于你的c ... -
mysql读写分离高级驱动
2013-11-25 09:58 1104负载均衡 http://dev.mysql.com/doc/r ... -
MySQL乱码处理
2013-11-25 09:50 6991。过滤器 2。头文件 3。MySQL数据库的 my.ini文 ... -
mysql日期函数
2013-11-25 09:48 694对于每个类型拥有的值范围以及并且指定日期何时间值的有效格式的描 ... -
MYSQL使用心得(二)----主从复制
2013-11-25 09:30 1603基本配置 主数据库 配置文件,修改server_id=1 建立 ... -
cmake的安装
2013-11-13 22:51 1302安装mysql5.5和5.6的时候,需要使用cmake编译,所 ... -
MYSQL使用心得(三)----性能与管理优化
2013-03-01 22:36 6910基于 /application/search/mysql/my ... -
MYSQL使用心得(五)----InnoDB与MyISAM
2012-11-08 21:31 1574本文主要整理了Mysql 两 ... -
MySQL基础----彻底解决phpMyAdmin安装问题
2011-02-11 12:27 3027一 环境 httpd-2.2.17-win32-x86-no_ ... -
centOS or ubuntu下安装mysql5.5
2010-12-31 16:10 3040依赖库 ubuntu apt-get install gcc ... -
MYSQL使用心得(四)----临时表与内存表
2010-12-19 14:43 3416mysql5.5性能优化-内存表 内存表分为2种,但共同点是, ... -
Mysql 5.5 无法远程登陆:Can't get hostname for your address
2010-12-17 13:06 5975昨天oracle刚发布了MySQL5.5.8和5.1.54,欣 ...
相关推荐
今天工作中需要对一台ubantu的系统安装mysql,因为以前一直使用的是centos,虽然它也是类unix但是和redhat或centos命令上还是有点差别。所以通过网上查阅资料,终于安装成功了,现在将步骤分享给大家,有需要的朋友们...
(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。 脚本属性: 持续更新,提供...
该角色在RHEL / CentOS服务器上安装和配置MySQL或MariaDB服务器。 角色任务 安装MySQL / MariaDB 重置mysql的root密码 创建数据库和用户 要求 支持的版本: Oracle MySQL 5.5 5.6 5.7 8.0 马里亚德 5.5 10.0...
ltmh 在 CentOS/Red Hat Debian 和 Ubuntu 是一个完全自动化的 LTMH/LNMH/LNMP/LTMP 安装脚本 该脚本是免费的 shell 脚本集合,用于快速部署LTMH / LNMH / LTMP / LNMP堆栈( Linux 、 Tengine / Nginx 、 MySQL / ...
(Linux、Nginx/Tengine/OpenResty、生产环境下MySQL/MariaDB/Percona、PHP、JAVA),适用于CentOS 6 7(包括红帽),Debian 6 9、Ubuntu 12~16 的 32 和 64。 脚本属性: 持续更新,提供Shell交互和自动安装 源码...
(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。 脚本属性: 持续更新,提供...
(Linux、Nginx/Tengine/OpenResty、生产环境下MySQL/MariaDB/Percona、PHP、JAVA),适用于CentOS 6 ~ 7(包括 redhat)、Debian 6 ~ 9、Ubuntu 12 ~ 16、Fedora 27~28 的 32 和 64。 脚本属性: 持续更新,提供...
rs-db-config Rackspace策划的数据库配置文件 MySQL / MariaDB ... my-5.6-rhel.cnf | 适用于RHEL / CentOS MySQL 5.6或MariaDB 10。 my-5.5-ubuntu.cnf | 适用于Ubuntu / Debian MySQL 5.5或MariaDB 5.5。
对于最初的ansible软件包,我使用了并保留了其初始文件夹结构,但将其更改为使用CentOS而不是Ubuntu。 该开发箱已配置以下内容: 它从最小使用CentOS 6.5 Nginx 1.8 PHP 5.6(使用PHP-FPM配置) MySQL 5.6 兔子...
Ansible角色,在RedHat / CentOS和Debian / Ubuntu Linux服务器上安装 。 要求 需要在服务器上安装unzip实用程序。 另外,不同的SonarQube版本需要不同的Java最低版本: SonarQube 5.0-5.5需要Java 7+ SonarQube ...
Inception_web本系统是MySQL自动化管理工具,配合Inception使用,基于...SQLAdvisor语句优化功能(安装模块)配置文件: config.py安装配置:要求:python2.7建议系统环境:CentOS 7 / Ubuntu 14+ 1.安装MySQL 5.6+数据
该角色在RHEL / CentOS服务器上安装和配置MySQL或MariaDB服务器。 角色任务 安装MySQL / MariaDB 重置mysql的root密码 创建数据库和用户 要求 支持的版本: OracleMysql 5.5 5.6 5.7 8.0 马里亚德 10.3 10.4...
ManishJoy_AjaxCart v... 先决条件如何检查想要查询更多的信息Apache 2.2或2.4 Ubuntu: apache2 -v CentOS: httpd -vPHP 5.6.x,7.0.2、7.0.4或7.0.6 php -v MySQL 5.6.x mysql -u [root user name] -p 反馈与支持
使用下表来验证您具有安装Magento软件的正确先决条件。 先决条件 如何检查 想要查询更多的信息 Apache 2.2或2.4 Ubuntu的apache2 -v CentOS的: httpd -v PHP 5.5.x或5.6.x php -v MySQL 5.6.x mysql -u [root
1. 服务器支持操作系统Linux(CentOS/Ubuntu/Debian/Redhat),推荐使用Cent0S7.0以上,不支持Windows操作系统; 2. Web服务器支持Nginx/Apache,推荐使用Nginx; 3. PHP要求版本7.2(非DEBUG版本),PHP要求安装扩展...
CentOS 6.5 或 Ubuntu 14.04 Ruby 2.1.2 MySQL 5.6 或 PostgreSQL 9.3 筹备 如果您使用 PostgreSQL,请将 Gemfile 中的 'mysql2' 替换为 'pg'。 在以下步骤中,以普通用户的权限执行命令。 安装说明¶ ↑ 使用 ...
该Dockerfile用于以下方面的预构建映像: 支持的发行版: Ubuntu 12.04-PHP 5.3,LTS(精确) Ubuntu 14.04-PHP 5.5,LTS(可信赖) Ubuntu 15.04-PHP 5.6... mysql客户端 dnsmasq ssmtp 监督的 PHP CLI和FPM
CIS_Oracle_MySQL_Enterprise_Edition_5.6_Benchmark_v1.1.0.pdf CIS_Oracle_Solaris_11.4_Benchmark_v1.0.0.pdf CIS_PostgreSQL_12_Benchmark_v1.0.0.pdf CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v2.2.0.pdf CIS...