[root@oracle11gtest mysqlsoftware]# tar -xzvf mysql-5.7.17.tar.gz
七:CMake
进入解压后的软件目录进行CMake,CMake的目的是生成makefile文件,为下一步编译做准备 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql / -DDEFAULT_CHARSET=utf8 / -DDEFAULT_COLLATION=utf8_general_ci / -DENABLED_LOCAL_INFILE=ON / -DWITH_INNOBASE_STORAGE_ENGINE=1 / -DWITH_FEDERATED_STORAGE_ENGINE=1 / -DWITH_BLACKHOLE_STORAGE_ENGINE=1 / -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 / -DWITH_PARTITION_STORAGE_ENGINE=1 / -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 / -DCOMPILATION_COMMENT='Mysqlma' / -DWITH_READLINE=ON / -DSYSCONFDIR=/data/mysqldata/3306 / -DMYSQL_UNIX_ADDR=/data/mysqldata/3306/mysql.sock 遇到一个报错: CMake Error at cmake/boost.cmake:81 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST= This CMake script will look for boost in . If it is not there, it will download and unpack it (in that directory) for you. If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80 Call Stack (most recent call first): cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST) CMakeLists.txt:455 (INCLUDE) -- Configuring incomplete, errors occurred! See also "/root/mysqlsoftware/mysql-5.7.17/CMakeFiles/CMakeOutput.log". See also "/root/mysqlsoftware/mysql-5.7.17/CMakeFiles/CMakeError.log". 解决办法,参考我另一篇博文:http://blog.itpub.net/20893244/viewspace-2133137/ 重新执行CMake,出现如下信息表示CMake通过: -- Configuring done -- Generating done -- Build files have been written to: /root/mysql-5.7.17
八:编译和安装,时间比较长需要耐心等待
[root@oracle11gtest mysql-5.7.17]# make & make install
在日志文件里会提示一个临时密码,记录这个密码 2017-02-07T01:50:22.772693Z 1 [Note] A temporary password is generated for root@localhost: /sxS7/15q 注意:5.7.6之前的版本需要用下面这条命令初始化 mysql_install_db
十一:安装ssl
执行:
./mysql_ssl_rsa_setup
十二:启动数据库
mysqld_safe --defaults-file=/data/mysqldata/3306/my.cnf & 启动之后查看日志有个error 2017-02-07T10:57:41.256534Z 0 [ERROR] SSL error: Unable to get private key from 'server-key.pem' 解决办法看我另一个博客:http://blog.itpub.net/20893244/viewspace-2133191/