• MYSQL5.5源码安装 linux下


    /* 首先安装必要的库 */
    yum -y install gcc*
    
    ###### 安装 MYSQL ######
    
    首先安装camke 
    一、支持YUM,则
    yum install -y cmake
    
    二、也可以源码安装
    [root@localhost ~]# cd /usr/local/src
    #下载cmake
    [root@localhost src]# wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
    [root@localhost src]# tar zxvf cmake-2.8.7.tar.gz
    [root@localhost src]# cd cmake-2.8.7
    #安装cmake
    [root@localhost cmake-2.8.7]# ./configure
    [root@localhost cmake-2.8.7]# make
    [root@localhost cmake-2.8.7]# make install
    
    /* 安装 MYSQL
    官网下载 MYSQL5.5版本 linux下源码包
    http://dev.mysql.com/downloads/
    */
    
    安装
    [root@localhost ~]# groupadd mysql
    [root@localhost ~]# useradd -g mysql mysql
    [root@localhost ~]# tar zxvf mysql-5.2.25.tar.gz
    [root@localhost ~]# cd mysql-5.2.25
    
    /* #cmake  .              //默认情况下安装,安装目录为/usr/local/mysql  数据目录为/usr/local/mysql/data
    #也可以指定参数安装,如指定UTF8,数据引擎等
    #具体参照http://dev.mysql.com/doc/refman/ ... ration-options.html
    */
    
    [root@localhost mysql-5.2.25]# 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
    [root@localhost mysql-5.2.25]# make && make install
    [root@localhost mysql-5.2.25]# cd /usr/local/mysql
    [root@localhost mysql]# chown -R mysql:mysql  /usr/local/mysql
    [root@localhost mysql]# ./scripts/mysql_install_db --user=mysql  -datadir=/mysql/data
    
    #此处如不指定datadir,到启动时会报错
    [root@localhost mysql]# chown -R root .
    [root@localhost mysql]# chown -R mysql data
    [root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf
    [root@localhost mysql]# ./bin/mysqld_safe --user=mysql &
    
    # Next command is optional
    [root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld
    [root@localhost mysql]# chmod +x /etc/init.d/mysqld
    [root@localhost mysql]# /etc/init.d/mysqld start
    到此,安装完成
    

      

    此处安装会遇到的错误!!

    报错如下:
    -- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
    CMake Error at cmake/readline.cmake:82 (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:126 (FIND_CURSES)
      cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
      CMakeLists.txt:250 (MYSQL_CHECK_READLINE)
    
    
    --〉
    解决方法:
    [root@localhost mysql-5.6.1]# rm CMakeCache.txt
    [root@localhost mysql-5.6.1]# yum install ncurses-devel
    [root@localhost mysql-5.5.11]# yum install bison
    接着继续执行编译
    #cmake......
    #make && make install
    

      

  • 相关阅读:
    C++ 字符串与数字之间的转换
    两种常见的模式匹配算法(代码实现)
    C++ string整行读取带空格的字符串
    JavaEE(一)开发环境搭建(JDK+Eclipse+Tomcat+Mysql+Spring)
    25java模拟容器的实现
    24java的StringBuilder类和StringBuffer类
    23java的String类常用方法
    22java的回调&内部类
    21java的抽象类和接口
    20java的组合&IDEA踩坑合集1
  • 原文地址:https://www.cnblogs.com/frankielf0921/p/5883900.html
Copyright © 2020-2023  润新知