一、关闭防火墙

chkconfig iptables off

service iptables stop

二、检查操作系统上是否安装了MySQL

[[email protected] backup]# rpm -qa |grep mysql

qt-mysql-4.6.2-26.el6_4.x86_64

mysql-5.1.71-1.el6.x86_64

mysql-server-5.1.71-1.el6.x86_64

mysql-devel-5.1.71-1.el6.x86_64

mysql-libs-5.1.71-1.el6.x86_64

三、删除MyQL(redhat6.3服务器自带的mysql-libs是mysql-libs-5.1.61-4.el6.x86_64,可能会和高版本的mysql-libs有冲突)

yum remove mysql-libs

四、确定MySQL相关包彻底删除

[[email protected] backup]# rpm -qa |grep mysql

五、下载mysql源码包,mysql-5.6.23.tar.gz

下载时注意别选成其他的linux安装包,不然编译肯定报错。选择平台的下拉列表里选择 Source Code,Select Platform: Source Code ,

下载 Generic Linux (Architecture Independent), Compressed TAR Archive。

六、添加用户和组:groupadd mysql #增加用户组

useradd -d /home/mysql -g mysql mysql

七、配MySQL环境变量

su - mysql

vi .bash_profile

PATH=$PATH:$HOME/bin:/u01/my3306/bin

source .bash_profile

八、创建目录及授权

mkdir -p /u01/my3306/data

mkdir -p /u01/my3306/log/iblog

mkdir -p /u01/my3306/log/binlog

mkdir -p /u01/my3306/log/relaylog

mkdir -p /u01/my3306/run

mkdir -p /u01/my3306/tmp

chown -R mysql:mysql /u01/my3306

chmod -R 777 /u01/my3306

九、解压

tar -zxvf mysql-5.6.23.tar.gz

cd mysql-5.6.23

十、编译并安装

cmake -DCMAKE_INSTALL_PREFIX=/u01/my3306 -DINSTALL_DATADIR=/u01/my3306/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_SSL=yes -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -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 -DMYSQL_UNIX_ADDR=/u01/my3306/run/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DSYSCONFDIR=/etc -DWITH_READLINE=on

make

make install

十一、参数配置/u01/my3306/my.cnf

[client]

port=3306

socket=/u01/my3306/mysql.sock

[mysql]

pid_file=/u01/my3306/run/mysqld.pid

[mysqld]

# disable autocommit

autocommit=0

general_log=off

explicit_defaults_for_timestamp=true

sha256_password_private_key_path=/u01/my3306/mykey.pem

sha256_password_public_key_path=/u01/my3306/mykey.pub

# system

basedir=/u01/my3306

datadir=/u01/my3306/data

max_allowed_packet=134217728

max_connections=8192

max_user_connections=8000

open_files_limit=65535

pid_file=/u01/my3306/run/mysqld.pid

port=3306

server_id=101

skip_name_resolve=ON

socket=/u01/my3306/run/mysql.sock

tmpdir=/u01/my3306/tmp

#binlog

#log-bin=/u01/my3306/log/binlog

log_bin=/u01/my3306/log/binlog/binlog

binlog_cache_size=32768

binlog_format=row

expire_logs_days=7

log_slave_updates=ON

max_binlog_cache_size=2147483648

max_binlog_size=524288000

sync_binlog=100

#logging

log_error=/u01/my3306/log/alert.log

slow_query_log_file=/u01/my3306/log/slow.log

log_queries_not_using_indexes=1

slow_query_log=1

log_slave_updates=ON

log_slow_admin_statements=1

long_query_time=1

#relay

relay_log=/u01/my3306/log/relaylog

relay_log_index=/u01/my3306/log/relay.index

relay_log_info_file=/u01/my3306/log/relay-log.info

#slave

slave_load_tmpdir=/u01/my3306/tmp

slave_skip_errors=OFF

#innodb

innodb_data_home_dir=/u01/my3306/log/iblog

innodb_log_group_home_dir=/u01/my3306/log/iblog

innodb_adaptive_flushing=ON

innodb_adaptive_hash_index=ON

innodb_autoinc_lock_mode=1

innodb_buffer_pool_instances=8

#default

innodb_change_buffering=inserts

innodb_checksums=ON

innodb_buffer_pool_size= 128M

innodb_data_file_path=ibdata1:32M;ibdata2:16M:autoextend

innodb_doublewrite=ON

innodb_file_format=Barracuda

innodb_file_per_table=ON

innodb_flush_log_at_trx_commit=1

innodb_flush_method=O_DIRECT

innodb_io_capacity=1000

innodb_lock_wait_timeout=10

innodb_log_buffer_size=67108864

innodb_log_file_size=1048576000

innodb_log_files_in_group=4

innodb_max_dirty_pages_pct=60

innodb_open_files=60000

innodb_purge_threads=1

innodb_read_io_threads=4

innodb_stats_on_metadata=OFF

innodb_support_xa=ON

innodb_use_native_aio=OFF

innodb_write_io_threads=10

[mysqld_safe]

datadir=/u01/my3306/data

十二、初始化MySQL脚本

rm -rf /u01/my3306/data/*

rm -rf /u01/my3306/log/iblog/*

rm -rf /u01/my3306/log/binlog/*

chmod -R 777 /u01/my3306/data/

chmod -R 777 /u01/my3306/log/iblog/

chmod -R 777 /u01/my3306/log/binlog/

chmod 755 /u01/my3306/my.cnf

./scripts/mysql_install_db --defaults-file=/u01/my3306/my.cnf --datadir=/u01/my3306/data --user=mysql

chmod -R 777 /u01/my3306/data/

chmod -R 777 /u01/my3306/log/iblog/

chmod -R 777 /u01/my3306/log/binlog/说明:defaults-file表示指定默认的配置文件,如果不指定,系统默认的优先级是先使用/etc/my.cnf作为mysql的配置文件,那之前make的那些参数就白设置了.

在初化时进行日志监控tail -f /u01/my3306/log/alert.log

**************************************************************************************************************

报错处理:

RSA private key file not found: /u01/my3306/data//private_key.pem. Some authentication plugins will not work.

RSA public key file not found: /u01/my3306/data//public_key.pem. Some authentication plugins will not work.

解决方法如下:

1. 检查是否安装openssl

$rpm -qa openssl

openssl-1.0.0-20.el6_2.5.x86_64

2.利用openssl生成公有和私有key

$ openssl genrsa -out mykey.pem 1024

Generating RSA private key, 1024 bit long modulus

..........++++++

.++++++

e is 65537 (0x10001)

$ openssl rsa -in mykey.pem -pubout -out mykey.pub

writing RSA key

$ ll mykey*

[[email protected] my3306]# ll mykey*

-rw-r--r-- 1 root root 891 Apr  1 20:35 mykey.pem

-rw-r--r-- 1 root root 272 Apr  1 20:35 mykey.pub

3.修改key的权限

chmod 755 /u01/my3306/mykey.pem

chmod 755 /u01/my3306/mykey.pub

$ ll mykey*

[[email protected] my3306]# ll mykey*

-rwxr-xr-x 1 root root 891 Apr  1 20:35 mykey.pem

-rwxr-xr-x 1 root root 272 Apr  1 20:35 mykey.pub

4、添加参数到[mysqld]中即: vi my.cnf

[mysqld]

sha256_password_private_key_path=/u01/my3306/mykey.pem

sha256_password_public_key_path=/u01/my3306/mykey.pub

**********************************************************************************************

十三、启动mysqlvi .bash_profile ---root用户下添加

PATH=$PATH:$HOME/bin:/u01/my3306/bin

mysqld_safe --defaults-file=/u01/my3306/my.cnf --user=mysql &

十四、登录MySQL

[[email protected] ~]# mysql -h127.0.0.1 -uroot

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.6.23-log Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show variables like ‘%log-bin%‘;

Empty set (0.00 sec)

mysql> show variables like ‘%bin%‘;

+-----------------------------------------+------------------------------+

| Variable_name | Value |

+-----------------------------------------+------------------------------+

| bind_address | * |

| binlog_cache_size | 32768 |

| binlog_checksum | CRC32 |

| binlog_direct_non_transactional_updates | OFF |

| binlog_error_action | IGNORE_ERROR |

| binlog_format | ROW |

| binlog_gtid_simple_recovery | OFF |

| binlog_max_flush_queue_time | 0 |

| binlog_order_commits | ON |

| binlog_row_image | FULL |

| binlog_rows_query_log_events | OFF |

| binlog_stmt_cache_size | 32768 |

| binlogging_impossible_mode | IGNORE_ERROR |

| innodb_api_enable_binlog | OFF |

| innodb_locks_unsafe_for_binlog | OFF |

| log_bin | ON |

| log_bin_basename | /u01/my3306/log/binlog |

| log_bin_index | /u01/my3306/log/binlog.index |

| log_bin_trust_function_creators | OFF |

| log_bin_use_v1_row_events | OFF |

| max_binlog_cache_size | 2147483648 |

| max_binlog_size | 524288000 |

| max_binlog_stmt_cache_size | 18446744073709547520 |

| simplified_binlog_gtid_recovery | OFF |

| sql_log_bin | ON |

| sync_binlog | 100 |

+-----------------------------------------+------------------------------+

26 rows in set (0.00 sec)

##################################################################################################################################

1.初始化MySQL脚本:

sh init3306.sh

rm -rf /u01/my3306/data/*

rm -rf /u01/my3306/log/iblog/*

rm -rf /u01/my3306/log/binlog/*

chmod -R 777 /u01/my3306/data/

chmod -R 777 /u01/my3306/log/iblog/

chmod -R 777 /u01/my3306/log/binlog/

chmod 755 /u01/my3306/my.cnf

./scripts/mysql_install_db --defaults-file=/u01/my3306/my.cnf --datadir=/u01/my3306/data --user=mysql

chmod -R 777 /u01/my3306/data/

chmod -R 777 /u01/my3306/log/iblog/

chmod -R 777 /u01/my3306/log/binlog/

2.启动MySQL脚本

sh start3306.sh

mysqld_safe --defaults-file=/u01/my3306/my.cnf --user=mysql &

3.登录MySQL脚本

sh logon3306.sh

mysql -h127.0.0.1 -uroot

原文:http://blog.csdn.net/guoyjoe/article/details/44813039

mysql 5.6.23 源码包安装报错_大环境下MySQL5.6源码安装实战一步步教你 CentOS6.5_64bit下编译安装...相关推荐

  1. mysql server安装报错_安装VtigerCRM报错:MySQL Server should be configured with

    安装报错提示如下: MySQL Server should be configured with: sql_mode = ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREA ...

  2. idea导包都报错_不仅仅要会导别人的包也要会导自定义的包——Python导包总结...

    1 前言 导包这个词我相信编程人员不会陌生.如何很好地在Python中导入别人的包以及自己写的工具函数?这时需要分清楚和用好的,特此总结以飨读者. 2 优雅地导入别人的包 当然这里主要指你使用pip( ...

  3. java类里的包路径报错_[ERROR] 致命错误: 在类路径或引导类路径中找不到程序包 java.lang...

    maven执行install时出现错误: [ERROR] [源文件的搜索路径: E:\project\IdeaProjects\weixin\leimingtech-core\src\main\jav ...

  4. sublime text3 安装插件方法,解决安装报错问题,wepy 框架文件 wpy 高亮插件:vue-syntax-highlight

    好久没安装 sublime text3 插件了,发现安装报错,本次小程序支持 wpy 文件,公用 Vue 高亮规则,需要升级下:vue-syntax-highlight 插件,需要排查下错误.记录下排 ...

  5. python中使用pip安装报错:Fatal error in launcher... 解决方法

    python中使用pip安装报错:Fatal error in launcher... 解决方法 参考文章: (1)python中使用pip安装报错:Fatal error in launcher.. ...

  6. tui-editor(富文本编辑器插件)安装报错处理方法

    tui-editor安装报错处理方法 项目中yarn或npm install时,tui-editor(富文本编辑器插件)安装报错. 显示 warning tui-editor > highlig ...

  7. mysql 5.6.23 源码包安装报错_CentOS6.5_64bit下编译安装MySQL-5.6.23

    ************************************************************ CentOS6.5_64bit下编译安装MySQL-5.6.23 ****** ...

  8. mysql源码安装报错_mysql 的二进制和源码包 安装的报错总结

    MySQL报错总结 报错原因:/application/mysql-5.6.44/tmp不存在 解决方法:mkdir /application/mysql-5.6.44/tmp 报错原因: /appl ...

  9. rpm安装mysql报错_【CentOS-65】通过rpm包安装mysql57解决了server报错和mysqld启动报错的问题...

    [CentOS-6.5]通过rpm包安装mysql5.7(解决了server包安装报错和mysqld启动报错的问题) 一.官网下载rpm包二.安装 wget三.检查是否已有数据库四.在linux在解压 ...

最新文章

  1. 破解自动机器学习的黑匣子
  2. oracle+数据到+mysql数据库乱码问题_Linux系统Oracle数据库乱码问题的解决方法
  3. Python_基础_5
  4. python 股票自动交易从零开始_Python股票自动交易从零开始
  5. scrapy-redis 使 redis 不止保存 url(例如:json)
  6. [CSS揭秘]伪随机背景
  7. MQTT工作笔记0001---MQTT协议概述
  8. Linux Suspend过程【转】
  9. Leetcode-403-青蛙过河(DFS+备忘录)
  10. Android官方教程翻译(2)——运行第一个程序
  11. http 协议入门
  12. 读just spring(一)(翻译的不好,都是用自己的话)
  13. Kubernetes单机创建MySQL+Tomcat演示程序:《Kubernetes权威指南》第一章demo报错踩坑
  14. Gitee推送本地文件到仓库并且创建子文件夹(详细)
  15. 详解CSS设置默认字体样式
  16. 计算机引导原理,计算机启动原理与多重引导.ppt
  17. CPU和cache的区别、RAM和ROM的区别、常见的名称缩写
  18. HMW案例拆解:iOS游戏免费榜第一名【网吧模拟器】如何提升留存率?
  19. 放个N老的程序,留着以后看
  20. Windows10下Vmware15.5虚拟机安装macOS BigSur 11.0(20A4299v).CDR镜像

热门文章

  1. 部署LAMP-WordPress站点上线
  2. b+树阶怎么确定_你知道危险品运输是怎么包装的吗?
  3. ue4加载本地版本_UE4中的本地化文本Localization Dashboard(多语言版本匹配)
  4. Spring Boot参数校验以及分组校验的使用
  5. 实时数仓入门训练营:实时计算 Flink 版 SQL 实践
  6. 基于边缘云的机器流量管理技术实战
  7. 从技术视角看考拉海购的云原生之路
  8. 连载:阿里巴巴大数据实践—数据建模综述
  9. 程序员养发(老师付推荐)
  10. ASP.NET Core微服务(七)——【docker部署linux上线】(RDS+API接口测试部分)