[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
-- MySQL 5.5.12
-- Could NOT find Threads (missing: Threads_FOUND)
删除已有的源码文件夹重新解压源码包或者删除源码文件夹中的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
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的,不需要明确指定,官方文档有说明:
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的配置是有区别的.
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。