`
gaojingsong
  • 浏览: 1201252 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

Linux中Mysql源码安装---编译安装

阅读更多

1、下载解压Mysql
[root@node1 ~]# wget http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.28.tar.gz
--13:12:16--  http://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.28.tar.gz
[root@node1 ~]# tar -zxvf mysql-5.6.28.tar.gz

2、安装cmake
[root@node1 ~]# tar -zxvf cmake-2.8.10.2.tar.gz
[root@node1 ~]# cd cmake-2.8.10.2
[root@node1 cmake-2.8.10.2]# ./configure
-- Performing Test run_pic_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /root/cmake-2.8.10.2
---------------------------------------------
CMake has bootstrapped.  Now run gmake.
[root@node1 cmake-2.8.10.2]# make
Scanning dependencies of target pseudo_valgrind
[100%] Building C object Tests/CTestTestMemcheck/CMakeFiles/pseudo_valgrind.dir/ret0.c.o
Linking C executable valgrind
[100%] Built target pseudo_valgrind
[root@node1 cmake-2.8.10.2]# make install
-- Installing: /usr/local/bin/cmake
-- Installing: /usr/local/bin/cpack
-- Installing: /usr/local/bin/ctest
-- Installing: /usr/local/man/man1/cmake.1
-- Installing: /usr/local/man/man1/cmakecommands.1
[root@node1 cmake-2.8.10.2]# cmake
cmake version 2.8.10.2
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

Options
  -C <initial-cache>          = Pre-load a script to populate the cache.
  -D <var>:<type>=<value>     = Create a cmake cache entry.
  -U <globbing_expr>          = Remove matching entries from CMake cache.
  -G <generator-name>         = Specify a makefile generator.
  -Wno-dev                    = Suppress developer warnings.
  -Wdev                       = Enable developer warnings.
  -E                          = CMake command mode.
  -i                          = Run in wizard mode.
  -L[A][H]                    = List non-advanced cached variables.
  --build <dir>               = Build a CMake-generated project binary tree.
  -N                          = View mode only.


 3、安装mysql
[root@node1 mysql-5.6.28]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
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:414 (MYSQL_CHECK_EDITLINE)
-- Configuring incomplete, errors occurred!
--【cmake出错解决方案:】
[root@node1 mysql-5.6.28]# rm -rf CMakeCache.txt
[root@node1 mysql-5.6.28]# yum -y install ncurses-devel*
Total download size: 3.3 M
Downloading Packages:
(1/2): ncurses-devel-5.5-24.20060715.i386.rpm                                                                                                                           | 1.6 MB     00:03    
(2/2): ncurses-devel-5.5-24.20060715.x86_64.rpm                                                                                                                         | 1.7 MB     00:04    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                          398 kB/s | 3.3 MB     00:08    
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : ncurses-devel                                     [1/2]
  Installing     : ncurses-devel                                     [2/2]

Installed: ncurses-devel.x86_64 0:5.5-24.20060715 ncurses-devel.i386 0:5.5-24.20060715
Complete!
4、重新安装mysql
[root@node1 mysql-5.6.28]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-- CMAKE_C_FLAGS:  -Wall -Wextra -Wformat-security -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -Wall -Wextra -Wformat-security -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: /root/mysql-5.6.28
[root@node1 mysql-5.6.28]# make
[100%] Building CXX object libmysqld/examples/CMakeFiles/mysqltest_embedded.dir/__/__/client/mysqltest.cc.o
Linking CXX executable mysqltest_embedded
[100%] Built target mysqltest_embedded
Scanning dependencies of target my_safe_process
[100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
Linking CXX executable my_safe_process
[100%] Built target my_safe_process
[root@node1 mysql-5.6.28]# make install
编译时候尽量分配多点内存,加块安装速度
-- Installing: /usr/local/mysql/sql-bench/innotest2a
-- Installing: /usr/local/mysql/sql-bench/innotest2
-- Installing: /usr/local/mysql/sql-bench/test-insert
-- Installing: /usr/local/mysql/sql-bench/innotest1b
-- Installing: /usr/local/mysql/sql-bench/test-alter-table
-- Installing: /usr/local/mysql/sql-bench/run-all-tests
-- Installing: /usr/local/mysql/sql-bench/test-transactions
-- Installing: /usr/local/mysql/sql-bench/README
-- Installing: /usr/local/mysql/sql-bench/bench-count-distinct
-- Installing: /usr/local/mysql/sql-bench/graph-compare-results
-- Installing: /usr/local/mysql/sql-bench/bench-init.pl
-- Installing: /usr/local/mysql/sql-bench/compare-results
-- Installing: /usr/local/mysql/sql-bench/server-cfg
-- Installing: /usr/local/mysql/sql-bench/copy-db
-- Installing: /usr/local/mysql/sql-bench/test-ATIS
-- Installing: /usr/local/mysql/sql-bench/test-big-tables
-- Installing: /usr/local/mysql/sql-bench/test-wisconsin
[root@node1 mysql-5.6.28]#
至此Linux源码安装Mysql完毕。

1
1
分享到:
评论

相关推荐

    mysql-5.7.18源码和connector C++源码在Linux在编译安装

    **MySQL 5.7.18源码编译安装** 1. **环境准备**:确保你是在Ubuntu 16.04环境下,该系统基于Debian,支持大多数开源软件的安装。你需要安装一些基本的开发工具,如`build-essential`,`cmake`,`libssl-dev`,`zlib...

    linux下mysql源码编译安装

    linux下源码编译安装mysql-5.6.25版本

    mysql-5.7.44-linux-glibc2.12-x86-64.tar.gz

    在Linux环境下,MySQL通常以源码形式安装,以便更好地适应系统环境。本文将深入探讨MySQL 5.7.44在Linux(glibc2.12)上的安装和使用。 1. **MySQL 5.7.44 特性** - **InnoDB存储引擎优化**:在5.7版本中,InnoDB...

    mysql-5.0.41-linux-i686-glibc23

    总之,"mysql-5.0.41-linux-i686-glibc23"是一个包含MySQL 5.0.41源码的压缩包,适用于Linux系统,特别是i686架构并依赖glibc23库的环境。通过编译安装,我们可以利用这个版本在Linux上搭建和管理数据库,满足各种...

    Linux运维-运维课程d1-MySQL介绍及安装-17-MySQL源码编译安装后的后续配置.mp4

    Linux运维-运维课程d1-MySQL介绍及安装-17-MySQL源码编译安装后的后续配置.mp4

    mysql源码安装编译

    至此,MySQL源码编译和安装完成。在整个过程中,我们了解了如何配置编译选项,使用CMake管理构建过程,以及如何处理编译依赖。这不仅有助于理解MySQL的工作机制,也为自定义和优化MySQL提供了基础。 在实际应用中,...

    Mysql 5.6 源码编译安装

    ### MySQL 5.6 源码编译安装详解 #### 一、前言 本文旨在详细介绍如何在Linux环境下从源码编译安装MySQL 5.6版本的过程。...希望本文能够帮助到那些正在学习或工作中需要用到MySQL源码编译安装的朋友。

    mysql-connector-c-6.0.2-linux-sles10-x86-64bit

    在实际应用中,开发人员会首先通过`configure`脚本来检查系统环境,然后使用`make`命令编译源码,最后使用`make install`将编译好的库文件安装到系统路径。开发人员在自己的C代码中,通过`#include`头文件,并链接...

    linux下源码安装mysql数据库

    - 为了能够编译MySQL源码,需要先安装一些必要的编译工具包,如`make`, `gcc-c++`, `cmake`, `bison-devel`, `ncurses-devel`, `perl`等。 ```bash [root@localhost ~]# yum -y install make gcc-c++ cmake bison...

    mysql-5.5.27 linux源码安装文件

    源码安装MySQL的优点在于,你可以完全控制编译过程,根据系统的特定需求定制配置,例如选择特定的编译选项、优化参数或添加额外的模块。以下是一步步进行源码安装的步骤: 1. **环境准备**: - 首先确保系统已安装...

    mha4mysql-node-0.58

    安装和配置MHA涉及多个步骤,包括安装依赖、编译源码、配置Manager和Node、设置监控和处理策略等。使用过程中,还需要对MySQL的主从复制配置有一定的了解,确保复制正常运行。 总之,MHA for MySQL Node 0.58为...

    Linux下源码编译MySQL 5.5 与安装程全记录

    在Linux环境下,源码编译安装MySQL 5.5是一个涉及多步骤的过程,这通常是为了获得更高的定制性和针对特定系统的优化。以下是一个详尽的步骤指南: 首先,我们需要准备必要的工具和依赖。从5.5版本开始,MySQL的源码...

    linux环境下MySQL源码编译安装

    linux环境下MySQL源码编译安装及初始化,使用cmake安装,如何添加配置文件,配置客户端,以及初始化。

    MySQL 5.6.25 源码包+安装方法 (mysql-5.6.25.tar.gz)

    Mysql 源码安装操作: 1. 创建用户 # groupadd mysql # useradd -g -r mysql mysql 2. 解压缩tar包 # tar xf mysql-5.6.25.tar.gz # cd mysql-5.6.25 3. 编译安装 # cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/...

    Linux系统安装-mysql-apache-php组建借鉴.pdf

    在本教程中,我们将探讨如何在Linux系统上安装MySQL、Apache和PHP,这三个组件是搭建LAMP(Linux、Apache、MySQL、PHP)服务器的基础。首先,我们从Linux系统的安装开始。 1. **Linux系统安装** - **系统分区**: ...

    mysqlmysql-connector交叉编译总结.doc

    mysqlmysql-connector交叉编译总结,详细说明如何将mysqlclient库交叉编译到arm、powerpc等环境

    linux下编译安装mysql,apache,php文档

    ### Linux环境下编译安装MySQL、Apache与PHP的详细步骤 #### 搭建环境与安装Linux 1. **安装虚拟机:** - 运行VMware Workstation。 - 双击“新建虚拟机”按钮。 - 选择安装文件路径。 - 在系统类型选择界面中...

    Linux系统安装-mysql-apache-php组建.pdf

    - 解压缩MySQL源码包,创建一个组和用户,分配权限,并启动MySQL。 - 使用`chown`和`chgrp`命令修改文件和目录的所有者和组。 - 初始化数据库:运行`scripts/mysql_install_db --user=mysql`,然后启动MySQL:`...

Global site tag (gtag.js) - Google Analytics