开发者社区> 问答> 正文

linux下mysql源代码安装出现问题:报错

[root@localhost mysql-5.5.12]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_SSL=yes  -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci  -DEXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306

在cmake的时候出现这个问题。。。所需要的包都装了。。。不知道问题出哪里了。。。大神们帮帮忙啊!!

-- MySQL 5.5.12

-- Could NOT find Threads (missing:  Threads_FOUND)
CMake Error at configure.cmake:152 (LIST):
  list sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
  CMakeLists.txt:239 (INCLUDE)

-- Could NOT find Threads (missing:  Threads_FOUND)
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/local/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:522 (TEST_BIG_ENDIAN)
  CMakeLists.txt:239 (INCLUDE)




-- Configuring incomplete, errors occurred!

展开
收起
kun坤 2020-06-14 11:01:12 840 0
1 条回答
写回答
取消 提交回答

  • 删除已有的源码文件夹重新解压源码包或者删除源码文件夹中的CMakeLists.txt,再次编译试试看!



    ######把包裹删了,然后重新安装了一下就好了,估计是我在里面写了个文件,然后干扰了安装。。。。谢谢!!######

    先清除一些已有的文件夹,之后执行下面的操作

    Setup 1:检查是否安装好了cmake——cmake -i
    安装cmake
    wget -c http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz
    tar -zxvf cmake-2.8.3.tar.gz
    cd cmake-2.8.3
    ./bootstrap
    ./configure
    make && make install
    Setup 2:
    安装MYSQL 5.5.8
    wget -c mysql.mirrors.pair.com/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz">http://mysql.mirrors.pair.com/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz

    tar -zxvf mysql-5.5.15.tar.gz

    cd mysql-5.5.15/
    cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DWITH_SSL=system -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -LH

    make && make install

    ######恩,谢谢!!######

    创建用户和用户组:

    sudo groupadd mysql 
    sudo useradd -g mysql -s /usr/sbin/nologin mysql

    sudo apt-get install cmake (自5.5起,MySQL使用cmake而非常见的configure生成Makefile)
    tar xzf Percona-Server-5.6.13-rc60.6.tar.gz
    cd Percona-Server-5.6.13-rc60.6
    cmake . \
    -DCMAKE_INSTALL_PREFIX=/png/percona/5.6.13 \
    -DSYSCONFDIR=/png/percona/5.6.13/etc \
    -DMYSQL_DATADIR=/png/percona/5.6.13/data \
    -DMYSQL_UNIX_ADDR=/png/percona/5.6.13/mysql.sock \
    -DMYSQL_TCP_PORT=3306 \
    -DWITH_INNOBASE_STORAGE_ENGINE=1 \
    -DWITH_ARCHIVE_STORAGE_ENGINE=1 \
    -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
    -DWITH_PARTITION_STORAGE_ENGINE=1 \
    -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
    -DWITH_INNODB_MEMCACHED=1 \
    -DWITH_SSL=system \
    -DENABLED_LOCAL_INFILE=1 \
    -DDEFAULT_CHARSET=utf8 \
    -DDEFAULT_COLLATION=utf8_general_ci \
    -DWITH_EXTRA_CHARSETS=all \
    -DENABLE_DOWNLOADS=1
    注意:MyISAM, MERGE, MEMORY, CSV这几个引擎是强制编译进MySQL的,不需要明确指定,官方文档有说明:
    http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html

    The MyISAM, MERGE, MEMORY, and CSV engines are mandatory (always compiled into the server) and need not be installed explicitly.
    /png/percona/5.6.13/etc/my.cnf配置参考:

    [mysqld]
    datadir = /png/percona/5.6.13/data
    socket = /png/percona/5.6.13/mysql.sock
    pid_file = /png/percona/5.6.13/mysql.pid
    user = mysql
    port = 3306
    default_storage_engine = InnoDB
    
    # InnoDB
    #innodb_buffer_pool_size = 128M
    #innodb_log_file_size = 48M
    innodb_file_per_table = 1
    innodb_flush_method = O_DIRECT
    
    # MyISAM
    #key_buffer_size = 48M
    
    # character-set
    character-set-server = utf8
    collation-server = utf8_general_ci
    
    # name-resolve
    skip-host-cache
    skip-name-resolve
    
    # LOG
    log_error = /png/percona/5.6.13/logs/error.log
    log-bin = /png/percona/5.6.13/logs/binlog
    general_log = ON
    general_log_file = /png/percona/5.6.13/logs/log.sql
    slow_query_log = ON
    slow_query_log_file = /png/percona/5.6.13/logs/slow.log
    long_query_time = 1
    
    # Others
    explicit_defaults_for_timestamp = true
    #max_connections = 500
    open_files_limit = 65535
    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
    
    [client]
    socket = /png/percona/5.6.13/mysql.sock
    port = 3306


    官方MySQL编译配置说明:
    http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html
    http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html

    官方MySQL配置说明:
    http://dev.mysql.com/doc/refman/5.6/en/server-options.html
    http://dev.mysql.com/doc/refman/5.5/en/server-options.html

    注意:5.5和5.6的配置是有区别的.

    2020-06-14 11:01:18
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载