• CentOS 6.5 源码安装MySQL5.6


    1:下载安装cmake (mysql5.5以后是通过cmake来编译的)

    #http://download.csdn.net/detail/csxuedn/7976005
    
    #wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
    
    # tar -zxv -f /root/cmake-2.8.4.tar.gz
    # cd cmake-2.8.4
    #./configure
    Error when bootstrapping CMake:
    Cannot find appropriate C++ compiler on this system.
    Please specify one using environment variable CXX.
    See cmake_bootstrap.log for compilers attempted.
    
     
    
       #yum install gcc-c++
    
    #./configure
    # make && make install
    

      

    2:创建mysql的安装目录及数据库存放目录

    #mkdir -p /gechong/mysql                 //安装mysql 
    #mkdir -p /gechong/mysql/data            //存放数据库
    

      

    3:创建mysql用户及用户组

    #groupadd mysql
    
    #useradd -g mysql -s /bin/false -M mysql
    

      

    4:安装mysql

    #wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.21.tar.gz
    

    [root@10-4-5-9 gechong]# ls
    mysql

    [root@10-4-5-9 gechong]# pwd
    /gechong

    
    

    [root@10-4-5-9 gechong]# tar -zxv -f /root/mysql-5.6.21.tar.gz

    [root@10-4-5-9 gechong]# cd mysql-5.6.21/

    编译:

     cmake . 
    -DCMAKE_INSTALL_PREFIX=/gechong/mysql 
    -DMYSQL_DATADIR=/gechong/mysql/data 
    -DDEFAULT_CHARSET=utf8 
    -DDEFAULT_COLLATION=utf8_general_ci 
    -DEXTRA_CHARSETS=all 
    -DENABLED_LOCAL_INFILE=1 
    

    报错了:

    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:427 (MYSQL_CHECK_EDITLINE)
    
    
    -- Configuring incomplete, errors occurred!
    

     

    #yum -y install ncurses-devel
    
    #rm -f CMakeCache.txt
    

      

    重新编译:

    # make clean

    # rm -f CMakeCache.txt

    # rm -rf /etc/my.cnf

     cmake . 
    -DCMAKE_INSTALL_PREFIX=/gechong/mysql 
    -DMYSQL_DATADIR=/gechong/mysql/data 
    -DDEFAULT_CHARSET=utf8 
    -DDEFAULT_COLLATION=utf8_general_ci 
    -DEXTRA_CHARSETS=all 
    -DENABLED_LOCAL_INFILE=1 
    
    #make && make install
    

     很慢。。。等着吧

     

    5:配置MySQL

    # cd /gechong/mysql
    # chown -R root:mysql .
    # chown -R mysql:mysql data

      

    6:

    # cp support-files/my-default.cnf /etc/my.cnf

      

    7:初始化权限表

    #scripts/mysql_install_db --user=mysql
    

      

    8:启动MySQL服务

    #ln -s /gechong/mysql/bin/mysql /usr/bin
    
    #service mysqld start 

    10:之后空用户登陆MySQL,删除空用户,对用户赋权限。

  • 相关阅读:
    silverlight重写TextBox PassWordBox
    android使用html开发
    SilverLight中DataGrid显示值转换
    STM32 GPIO 的配置与使用
    开始。。
    VCS使用指令
    【转】关闭 Windows 7中的 6to4 隧道
    DC中关于list、双引号和花括号的使用区别
    解决了microblaze在ISE中例化时自动插入IO buffer
    Recovery time 和 Removal time的概念
  • 原文地址:https://www.cnblogs.com/xiaoit/p/3994092.html
Copyright © 2020-2023  润新知