首页 > 数据库 > mysql > 安装percona-server的时候报错
2015
07-19

安装percona-server的时候报错

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
— Check size of unsigned short – failed
— Check size of unsigned int

CMake Error at /usr/share/cmake/Modules/CMakeCInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
— Check size of unsigned int – failed
— Check size of unsigned long
CMake Error at /usr/share/cmake/Modules/CMakeCInformation.cmake:37 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
— Check size of unsigned long – failed
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:44 (message):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:646 (TEST_BIG_ENDIAN)
是因为缺少一些开发包
yum -y install gcc ncurses-devel gcc-c++ bison
安装好后要把目录下生成的CMakeCache.txt 文件删除掉 再重新cmake
rm CMakeCache.txt 
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/usr/local/mysql/etc -DMYSQL_DATADIR=/data/mysql -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1
make && make install
拷贝启动脚本,并设置开机启动 
 * cp support-files/mysql.server /etc/init.d/mysqld 
 * chmod +x /etc/init.d/mysqld 创建相关目录 
 * mkdir -p /usr/local/mysql/etc 
 * mkdir -p /usr/local/mysql/logs/ 
 移除系统默认的mysql配置文件 * mv /etc/my.cnf /etc/my.cnf.bak 

配置MySQL

  • 以上步骤都没问题的情况,开始配置MySQL,配置文件内容如下
  • [mysqld]
  • character_set_server=utf8
  • #Misc
  • user = mysql
  • port = 3306
  • socket = /tmp/mysql.sock
  • basedir = /usr/local/mysql
  • datadir =  /usr/local/mysql/data
  • ft_min_word_len=1
  • max_allowed_packet = 32M
  • #Performance
  • log-bin=mysql-bin
  • binlog_format=”MIXED”
  • net_read_timeout = 60
  • wait_timeout = 100
  • interactive_timeout = 100
  • open_files_limit = 10240
  • back_log = 150
  • max_connections = 1000
  • max_connect_errors = 100000
  • external-locking = FALSE
  • performance_schema = 0
  • #buffers & cache
  • table_open_cache = 2048   #在mysql5.6不再支持table_cache
  • table_definition_cache = 2048
  • max_heap_table_size = 246M
  • sort_buffer_size = 2M
  • join_buffer_size = 2M
  • thread_cache_size = 256
  • #thread_concurrency = 8
  • query_cache_size = 32M
  • query_cache_limit = 2M
  • query_cache_min_res_unit = 2k
  • thread_stack = 192K
  • read_buffer_size = 1M
  • read_rnd_buffer_size = 16M
  • bulk_insert_buffer_size = 64M
  • #logs
  • log-error=/usr/local/mysql/logs/mysql.err
  • log_warnings = 2
  • slow-query-log
  • slow-query-log-file=/use/local/mysql/logs/slow-log.log
  • long_query_time = 2
  • log-queries-not-using-indexes = 1
  • log-slow-admin-statements = 1
  • log-slow-slave-statements = 1
  • #binlog & replication
  • server-id = 2086 #如果需要做主从的话,此项必须要不同
  • binlog_format = ROW
  • binlog-row-image = minimal
  • binlog_cache_size = 4M
  • max_binlog_cache_size = 2G
  • max_binlog_size = 1G
  • expire_logs_days = 7
  • relay-log-purge = 1
  • sync_binlog = 0
  • skip-slave-start = 1
  • log-slave-updates  = 1
  • #Myisam engine
  • key_buffer_size = 32M
  • myisam_sort_buffer_size = 128M
  • myisam_max_sort_file_size = 10G
  • myisam_repair_threads = 1
  • myisam_recover
  • lower_case_table_names = 1
  • skip-name-resolve
  • slave-skip-errors = 1032,1062
  • #Innodb engine
  • innodb_additional_mem_pool_size = 16M
  • innodb_buffer_pool_size = 768M
  • innodb_data_file_path = ibdata1:1G:autoextend
  • innodb_file_per_table = 1
  • innodb_thread_concurrency = 0
  • innodb_flush_log_at_trx_commit = 2
  • innodb_log_buffer_size = 16M
  • innodb_log_file_size = 256M
  • innodb_log_files_in_group = 3
  • innodb_max_dirty_pages_pct = 75
  • innodb_lock_wait_timeout = 120
  • innodb_rollback_on_timeout
  • innodb_status_file = 1
  • innodb_io_capacity = 800
  • transaction_isolation = READ-COMMITTED
  • innodb_flush_method = O_DIRECT
  • innodb-support-xa = 0
  • innodb_read_io_threads = 8
  • innodb_write_io_threads = 8
  • innodb_file_format = Barracuda
  • skip-name-resolve
  • log_slave_updates = 1
  • #auto_increment_increment=2
  • #auto_increment_offset=1
  • [mysqldump]
  • quick
  • max_allowed_packet = 32M
  • 初始化MySQL

  • * cd /usr/local/mysql * scripts/mysql_install_db --defaults-file=/usr/local/mysql/etc/my.cnf --user=mysql 
  • 
    
  • 然后就可以启动了
最后编辑:
作者:saunix
大型互联网公司linux系统运维攻城狮,专门担当消防员