Mysql 5.7.17 編譯安裝
環境準備:
mysql 安裝包:mysql-5.7.17.tar.gz
軟體下載 :http://mirrors.sohu.com/mysql/MySQL-5.7/
yum源:
1
2
3
4
5
6
7
|
[root@web_1 ~] # cat /etc/yum.repos.d/server.repo
[ local ]
name= local
baseurl= file : ///mnt/cdrom
gpgcheck=0 enabled=1 [root@web_1 ~] #
|
系統版本:
1
2
3
4
|
[root@web_1 ~] # cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) [root@web_1 ~] # uname -r
3.10.0-327.el7.x86_64 |
安裝依賴包:
1
|
[root@web_1 mysql-5.7.17] # yum install -y libaio-devel ncurses-devel cmake gcc-c++ bison
|
建立使用者及解壓:
1
2
3
4
|
[root@web_1 mysql-5.7.17] # useradd -s /sbin/nologin -M mysql
[root@web_1 mysql-5.7.17] #mkdir -p /data/3307/data
[root@web_1 mysql-5.7.17] # tar xf mysql-5.7.17.tar.gz
[root@web_1 mysql-5.7.17] # cd mysql-5.7.17/
|
編譯安裝:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
[root@web_1 mysql-5.7.17] # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.7.17/ -DMYSQL_DATADIR=/usr/local/mysql-5.7.17/data -DMYSQL_UNIX_ADDR=/usr/local/mysql-5.7.17/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii -DENABLED_LOOCAL_INFILE=ON -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITHOUT_PARRTITION_STORAGE_ENGINE=1 -DWITH_FAST_MUTEXES=1 -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1-DWITH_DEBUG=0
-- Running cmake version 2.8.11 -- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U -- SIZEOF_VOIDP 8 -- MySQL 5.7.17 -- Packaging as: mysql-5.7.17-Linux-x86_64 -- Looked for boost /version .hpp in and
-- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND -- LOCAL_BOOST_DIR -- LOCAL_BOOST_ZIP -- Could not find (the correct version of) boost.
-- MySQL currently requires boost_1_59_0 CMake Error at cmake /boost .cmake:81 (MESSAGE):
You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>
This CMake script will look for boost in <directory>. 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! |
編譯報錯!!!!!
從標出的紅色部分可以看出是缺少依賴google一番後 找到解決方案
mysql5.7.5以後都需要 boost
下載地址:https://sourceforge.net/projects/boost/files/boost/1.59.0/
安裝boost:
1
2
3
4
|
[root@web_1 mysql-5.7.17] # tar -xf boost_1_59_0.tar.gz
[root@web_1 mysql-5.7.17] # cd boost_1_59_0/
[root@web_1 mysql-5.7.17] # mkdir /usr/local/boost
[root@web_1 mysql-5.7.17] # cp -a ./* /usr/local/boost/
|
再次編譯(指定boost路徑):
#增加了boost路徑 -DWITH_BOOST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
[root@web_1 mysql-5.7.17] # cmake \
-DCMAKE_INSTALL_PREFIX= /usr/local/mysql \
-DMYSQL_DATADIR= /data/3307/data \ #自定義目錄
-DSYSCONFDIR= /data/3307 \ #自定義目錄
-DMYSQL_USER=mysql \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_READLINE=1 \ -DMYSQL_UNIX_ADDR= /data/3307/mysql .sock \ #自定義目錄
-DMYSQL_TCP_PORT=3307 \ #自定義埠
-DENABLED_LOCAL_INFILE=1 \ -DENABLE_DOWNLOADS=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_DEBUG=0 \ -DMYSQL_MAINTAINER_MODE=0 \ -DWITH_SSL:STRING=bundled \ -DWITH_ZLIB:STRING=bundled \ -DWITH_BOOST= /usr/local/boost
[root@web_1 mysql-5.7.17] # make && make install
|
make過程中報以下錯誤!!!
1
2
3
4
5
6
7
8
9
|
[ 75%] Built target sqlgunitlib [ 75%] Building CXX object unittest /gunit/CMakeFiles/merge_small_tests-t . dir /merge_small_tests .cc.o
c++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate.
See <http: //bugzilla .redhat.com /bugzilla > for instructions.
make [2]: *** [unittest /gunit/CMakeFiles/merge_small_tests-t . dir /merge_small_tests .cc.o] Error 4
make [1]: *** [unittest /gunit/CMakeFiles/merge_small_tests-t . dir /all ] Error 2
make : *** [all] Error 2
|
google一番後發現是 記憶體不夠 swap分割槽也不夠
解決方案:
1
2
3
|
[root@web_1 ~] # dd if=/dev/zero of=/swapfile bs=1k count=2048000
[root@web_1 ~] # mkswap /swapfile
[root@web_1 ~] # swapon /swapfile
|
初始化:
1
|
[root@web_1 3307] # mysqld --defaults-file=/data/3307/my.cnf --initialize-insecure --user=mysql
|
啟動服務:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
[root@web_1 3307] # mysqld_safe --user=mysql &
[root@web_1 data] # mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3
Server version: 5.7.17-log Source distribution Copyright (c) 2000, 2016, Oracle and /or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and /or its
affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)
mysql> |
安裝完成!
本文轉自 chaunceyjiang 51CTO部落格,原文連結:http://blog.51cto.com/cqwujiang/1900875,如需轉載請自行聯絡原作者
相關文章
- Ubuntu 16.04下 Mysql5.7.17原始碼編譯與安裝UbuntuMySql原始碼編譯
- MySQL5.7.17原始碼編譯安裝時的注意事項MySql原始碼編譯
- mysql-5.7.17-winx64安裝MySql
- 編譯安裝mysql編譯MySql
- CentOS 6.5下快速安裝MySQL 5.7.17CentOSMySql
- MySQL 5.7.17 for WIN8安裝初探MySql
- 【MySQL安裝】Linux下安裝MySQL(預編譯)MySqlLinux編譯
- MySQL5.5.24編譯安裝MySql編譯
- MySQL 5.6.19編譯安裝MySql編譯
- linux mysql 安裝步驟- 原始碼安裝5.7.17 版本LinuxMySql原始碼
- 如何編譯安裝MySQL8.0編譯MySql
- 編譯安裝nginx-php-mysql編譯NginxPHPMySql
- MySQL 5.6 for REHL 6.4編譯安裝MySql編譯
- 原始碼編譯安裝MySQL 5.7.9原始碼編譯MySql
- [LAMP]Mysql-5.6.28編譯安裝LAMPMySql編譯
- 【轉】MySQL原始碼編譯安裝MySql原始碼編譯
- mysql5.7.17 64位rhel6.5下安裝MySql
- MySQL 5.7.17 原始碼方式安裝詳細步驟MySql原始碼
- MySQL 5.6原始碼編譯安裝流程MySql原始碼編譯
- 在solrais下編譯安裝MySQL(轉)SolrAI編譯MySql
- orthanc 編譯安裝mysql S3編譯MySqlS3
- CentOS7.4使用rpm包安裝mysql5.7.17CentOSMySql
- 阿里雲mysql原始碼編譯安裝阿里MySql原始碼編譯
- MySQL免編譯安裝及登入(5.6.36)MySql編譯
- MySQL5.7.16原始碼編譯安裝MySql原始碼編譯
- Cnetos7編譯安裝MySQL教程。編譯MySql
- centos手動編譯安裝apache、php、mysqlCentOS編譯ApachePHPMySql
- CentOS 6.4下編譯安裝MySQL 5.6.14CentOS編譯MySql
- CentOS 7 原始碼編譯安裝 Mysql 5.7CentOS原始碼編譯MySql
- MySQL 5.7.9原始碼編譯安裝說明MySql原始碼編譯
- windows中安裝MySQL綠色社群版(5.7.17-winx64)WindowsMySql
- MySQL 5.7.17 安裝報錯SSL error: Unable to get private key fromMySqlError
- 編譯安裝zabbix編譯
- apache編譯安裝Apache編譯
- 編譯安裝nmon編譯
- swoole 編譯安裝編譯
- 編譯安裝Nginx編譯Nginx
- nginx編譯安裝Nginx編譯