linux mysql5.6.27源码安装和错误解决

centos
mysql5.6.27
1编译安装
先进入到文件放置的路径下
创建一个个文件
#mkdir–p /data/mysql/mysql
#mkdir–p /data/mysql/mysqldat
2创建用户和用户组
groupadd mysql
useradd -r -g mysql mysql
3赋予数据存放目录权限
chown mysql:mysql -R /data/mysql/mysqldata/
4解压
tar -xvf mysql-5.6.27.tar.gz
5安装cmake
yum -install cmake -y
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DENABLED_LOCAL_INFILE=1
– Running cmake version 2.8.12.2
– Could NOT find Git (missing: GIT_EXECUTABLE)
– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error: your C compiler: “CMAKE_C_COMPILER-NOTFOUND” was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: “CMAKE_CXX_COMPILER-NOTFOUND” was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at cmake/os/Linux.cmake:27 (STRING):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:149 (INCLUDE)
CMake Error at cmake/os/Linux.cmake:27 (STRING):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:149 (INCLUDE)
– MySQL 5.6.27
– Packaging as: mysql-5.6.27-Linux-i686
– Could NOT find Threads (missing: Threads_FOUND)
– Could NOT find Threads (missing: Threads_FOUND)
– Check if the system is big endian
– Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:44 (message):
no suitable type found
Call Stack (most recent call first):
configure.cmake:628 (TEST_BIG_ENDIAN)
CMakeLists.txt:398 (INCLUDE)
– Configuring incomplete, errors occurred!
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log”.
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log”.
分析:
– Could NOT find Git (missing: GIT_EXECUTABLE)这项应该缺少git包,yum install -y git
– The C compiler identification is unknown
– The CXX compiler identification is unknown 这两项缺少gcc和gcc-c++的包,yum install -y gcc gcc-c++
另外需要rm CMakeCache.txt
继续
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1
出现错误:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
– Check size of wchar_t - failed
– Check size of wctype_t
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
– Check size of wctype_t - failed
– Check size of wint_t
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
– Check size of wint_t - failed
– Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:128 (FIND_CURSES)
cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:409 (MYSQL_CHECK_EDITLINE)
– Configuring incomplete, errors occurred!
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log”.
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log”.
分析:
– Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
缺少ncurses-devel包,yum install -y ncurses-devel
rm CMakeCache.txt

通过阅读官方文件http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html,去除选项-DWITH_READLINE=1和-DWITH_SSL=YES
重新
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DENABLED_LOCAL_INFILE=1
出现warning:
– Running cmake version 2.8.12.2
– MySQL 5.6.27
– Packaging as: mysql-5.6.27-Linux-x86_64
– HAVE_VISIBILITY_HIDDEN
– HAVE_VISIBILITY_HIDDEN
– HAVE_VISIBILITY_HIDDEN
– Using cmake version 2.8.12.2
– Not building NDB
– Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
Warning: Bison executable not found in PATH
– Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
– CMAKE_BUILD_TYPE: RelWithDebInfo
– COMPILE_DEFINITIONS: HAVE_CONFIG_H
– CMAKE_C_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
– CMAKE_CXX_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
– CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
– CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
– Configuring done
– Generating done
– Build files have been written to: /usr/local/src/mysql-5.6.27
分析:Warning: Bison executable not found in PATH 缺少Bison,yum install -y bison
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DENABLED_LOCAL_INFILE=1
echo $? 是0代表OK
6.make && make install
7.chown -R mysql:mysql /usr/local/mysql/
8.cd /usr/local/mysql/
9. ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql 初始化
10. cp support-files/my-default.cnf /etc/my.cnf
11. cp support-files/mysql.server /etc/init.d/mysqld
12. chmod 755 /etc/init.d/mysqld
13.vim /etc/init.d/mysqld 修改datadir=/data/mysql
14.service mysqld start
15ln -s /usr/local/mysql/bin/mysql /usr/bin
16mysql -u root -p没密码
成功启动Starting MySQL… SUCCESS!

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/427143.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mysql集群和主从区别_搭建MySQL主从集群,主从复制过程中同步延迟问题

上一节我们成功搭建了主从复制、读写分离,实际上并发量和数据量不大的情况下,使用起来也是非常的流畅,无任何问题,可以正常运行了。但是,要保证高可用,高并发的情况,可以写数据库master就有累了…

java I O类大全_Java I/O最简单的几个类

今天把I/O中最简单的几个类整理了一下,之所以整理最简单的,是因为这样会让我更加快速方便的理顺这里面的东西,以前每一次用的时候都要先百度一下,觉得很烦。首先需要先看一下Read,Write和Stream,那么看下面的图就明确多…

linux mysql数据库备份并删除前一分钟的数据

linux 中mysql数据库定时备份并删除前一分钟的所有数据 #!/bin/bash #mysqldump -uroot -ppassword01! imaginebase > /home/backup/imaginebase_KaTeX parse error: Expected EOF, got # at position 27: …%d_%H%M%S).sql #̲mysqldump -uroo…(date %Y%m%d_%H%M%S).sql.g…

打开 igv java_必备可视化Integrative Genomic Viewer(IGV)

你会用到的网站:写在前面:之前mac不小心升级了一下java,然后igv就不能用了,要写教程必须降级java首先,看官方说明,需要安装Java -8,9以上版本不支持。我的mac不知道什么时候更新到了java 10&…

机器学习项目笔记

项目清单: 1. 商业目标2. 划定问题               监督或非监督,还是强化学习。3. 选择什么算法             回归还是分类, 数据量小可使用单机内存的 批量计算, 数据量大使用分布式的MapReduce 线上计算。4. 评估模型…

linux mysql主从配置

1准备两台服务器 一台是192.168.118.128 一台是192.168.118.129 2主服务器配置 192.168.118.128 修改my.cnf文件 server-id1 log-binmysql-bin #启动MySQL二进制日志系统, binlog-do-dbourneeddb #需要同步的数据库 binlog-ignore-dbmysql #不同步mysql系统数据库&…

svn新建仓库

1昨天需要在服务器上新建一个仓库,解决方法是把已有的仓库拷贝出来,库删除在放进去 2然后今天想看看有没有命令的方法 find / -name project 首先查看一下项目的位置 3创建仓库 svnadmin create /mnt/raid1/huge/project/test 4cd test Ls 5vi authz…

MySql数据库索引原理

写在前面:索引对查询的速度有着至关重要的影响,理解索引也是进行数据库性能调优的起点。考虑如下情况,假设数据库中一个表有10^6条记录,DBMS的页面大小为4K,并存储100条记录。如果没有索引,查询将对整个表进…

java实现坐标图进行拖拉拽放_js实现限定区域范围拖拉拽效果

本文实例为大家分享了js实现限定区域范围拖拉拽的具体代码,供大家参考,具体内容如下需要在范围内拖拉拽,之前看来许多资料觉得都不是特别满足要求,今天自己写了一个,通过监听鼠标按下、鼠标抬起、鼠标移动事件来控制代…

mysql + keepalived高可用

1上次说过了mysql的主从配置 tar zxf keepalived-1.2.7.tar.gz cd keepalived-1.2.7 yum install gcc gcc-c yum install kernel-devel -y 2报错 configure: error: Popt libraries is required yum install popt-devel 3继续执行 ./configure --with-kernel-dir/usr/src/kerne…

java+向前进一_Java 线程基础

前言线程并发系列文章:熟练掌握线程原理与使用是程序员进阶的必经之路,网上很多关于Java线程的知识,比如多线程之间变量的可见性、操作的原子性,进而扩展出的Volatile、锁(CAS/Synchronized/Lock)、信号量等知识。有些文章只说笼统…

电子报账系统源码_网上商城系统建设心得,轻松搞定选择困难

当前,我们正处于一个互联网飞速发展的时代,特别是互联网电商的出现,给我们的生活带来了翻天覆地的变化,不出家门便可购买各种商品,不用再到处奔走寻找,通过网络便可快速下单,然后坐等送货上门。…

源码安装httpd

1 tar -xvf apr-1.7.0.tar.gz tar -xvf apr-util-1.6.1.tar.gz tar -xvf httpd-2.2.6.tar.gz 2cd apr-1.7.0 ./configure Make Make install 3cd apr-util-1.6.1 ./configure --with-apr/usr/local/apr 解决rpm -ivh libexpat-devel-2.2.4-alt1.i586.rpm tar -xvf expat-2.2…

python如何运行py程序_如何用Python汇款:Web3.py教程

Python开发人员对于以太坊和区块链库的技术练习。警告:下面的教程包含这些元素:显式加密、点对点金融服务以及可能的违规行为。这些例子仅仅是为了说明Python区块链的强大功能和便捷性。嗨,Pythoners,你们好!我真的很喜…

基于域名的apache服务器

1承接上个博客说的&#xff0c;咱们继续扩展 Cd /usr/local/apache2/conf /usr/local/apache2/conf/extra扩展文件 Vi httpd-vhosts.conf <VirtualHost *:80> ServerAdmin 1327629137qq.com DocomentRoot “/data/webapps/www1” ServerName www.wugk1.com <Directory…

MySQL 数据库修改登录密码

MySQL 数据库修改登录密码、、 -------- mysql修改密码 默认的密码为空&#xff1a;mysql -u root -p第一次更改密码&#xff1a;mysqladmin -uroot -p password xhyEnter password: xhy 第二次更改密码&#xff1a; mysqladmin -uroot -pxhy password xhy1mysql -u root -p En…

python列表统计每个元素出现次数_python 统计list中各个元素出现的次数的几种方法...

利用字典dict来完成统计举例&#xff1a;a [1, 2, 3, 1, 1, 2]dict {}for key in a:dict[key] dict.get(key, 0) 1print dict输出结果&#xff1a;>>>{1: 3, 2: 2, 3: 1}利用Python的collection包下Counter的类举例&#xff1a;from collections import Countera …

raid5需要几块硬盘_Raid5磁盘阵列数据恢复思路分析--附真实案例

1.raid5磁盘阵列数据恢复思路分析Raid5磁盘阵列是一种相对安全的磁盘阵列形式&#xff0c;数据分布状态有点类似于raid0磁盘阵列。但是raid5阵列比raid0阵列更为安全的一点就是阵列的每一组平行数据块中都包含了一个校验块&#xff0c;校验块的作用主要表现在阵列有一块硬盘掉线…

Linux思维导图之sed、实战习题

命令解释&#xff1a; ◆sed 2p /etc/passwd第二行打印了两次其余一次 ◆sed-n 2p /etc/passwd 只打印出第二行 ◆sed-n 1,4p /etc/passwd 只打印出1到4行 ◆sed-n /root/p /etc/passwd只打印出root的行 ◆ sed-n 2./root/p /etc/passwd打印从2行开始往下到root行 ◆sed-n /^$/…

jenkins安装(1)

1先在互联网上输入jenkins.io 2下载jenkins.war 3上传到服务器上 安装jdk前面的博客已经说过了 4 Jenkins requires Java versions [8, 11] but you are running with Java 1.7 from /usr/java/jdk1.7.0_06/jre java.lang.UnsupportedClassVersionError: 51.0 at Main.verifyJa…