MySQL编译安装常见问题及解决方法
创作时间:
作者:
@小白创作中心
MySQL编译安装常见问题及解决方法
引用
CSDN
1.
https://blog.csdn.net/qq_24428851/article/details/141366017
MySQL编译安装常见问题及解决方法
MySQL编译安装时需要安装的依赖(全):
yum install -y cmake
yum install ncurses ncurses-devel -y
yum install -y libarchive
yum install -y gcc gcc-c++
yum install -y openssl openssl-devel
yum install -y libtirpc libtirpc-devel
问题1
错误提示:
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:71 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:100 (FIND_CURSES)
cmake/readline.cmake:193 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:581 (MYSQL_CHECK_EDITLINE)
原因:缺少依赖
解决方法:
yum install ncurses ncurses-devel -y
问题2
错误提示:
CMake Error at cmake/boost.cmake:88 (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:174 (COULD_NOT_FIND_BOOST)
CMakeLists.txt:547 (INCLUDE)
原因:没有指定boost位置,或boost位置错误
解决方法:
使用cd指令或ls等指令验证boost路径是否正确,修改即可。如果没有boost就需要下载,然后指定就可以了。
问题3
错误提示:
-bash: cmake: command not found
原因:没有安装cmake
解决方法:
yum install -y cmake
问题4
错误提示:
cmake: symbol lookup error: cmake: undefined symbol: archive_write_add_filter_zstd
原因:缺少依赖
解决方法:
yum install -y libarchive
问题5
错误提示:
CMake Error at CMakeLists.txt:146 (PROJECT):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
原因:缺少gcc-c++
解决方法:
yum install -y gcc gcc-c++
问题6
错误提示:
Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),
</path/to/custom/openssl/installation>
CMake Error at cmake/ssl.cmake:63 (MESSAGE):
Please install the appropriate openssl developer package.
Call Stack (most recent call first):
cmake/ssl.cmake:280 (FATAL_SSL_NOT_FOUND_ERROR)
CMakeLists.txt:579 (MYSQL_CHECK_SSL)
原因:缺少依赖
解决方法:
yum install -y openssl openssl-devel
问题7
错误提示:
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
-- Checking for module 'libtirpc'
-- Package 'libtirpc', required by 'virtual:world', not found
CMake Error at cmake/rpc.cmake:76 (MESSAGE):
Could not find rpc/rpc.h in /usr/include or /usr/include/tirpc
Call Stack (most recent call first):
rapid/plugin/group_replication/configure.cmake:60 (MYSQL_CHECK_RPC)
rapid/plugin/group_replication/CMakeLists.txt:25 (INCLUDE)
原因:缺少依赖
解决方法:
yum install -y libtirpc libtirpc-devel
问题8
错误提示:
CMake Error at rapid/plugin/group_replication/rpcgen.cmake:100 (MESSAGE):
Could not find rpcgen
Call Stack (most recent call first):
rapid/plugin/group_replication/CMakeLists.txt:36 (INCLUDE)
原因:缺少依赖
解决方法:
安装rpcsvc-proto
安装rpcsvc-proto方法如下:
下载rpcsvs-proto
https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4.2/rpcsvc-proto-1.4.2.tar.xz
解压
tar -xvf rpcsvc-proto-1.4.2.tar.xz
配置编译安装
./configure
make && make install
注意:如果下载的是tar.gz包,这个包需要手动生成configure文件后才能编译安装rpcvsc-proto,需要安装很多依赖项,很繁琐,后面单独介绍
https://github.com/thkukuk/rpcsvc-proto/archive/refs/tags/v1.4.2.tar.gz
MySQL编译安装常用选项
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ #指定MySQL安装目录
-DSYSCONFDIR=/usr/local/mysql/etc \ #指定MySQL配置文件my.cnf文件目录
-DMYSQL_USER=mysql \ #指定MySQL运行用户
-DDEFAULT_CHARSET=utf8 \ #指定默认字符集
-DDEFAULT_COLLATION=utf8_general_ci \ #指定默认排序字符集
-DMYSQL_DATADIR=/mysql/data \ #指定数据文件存放路径
-DWITH_BOOST=/usr/local/src/mysql-5.7.30/boost/boost_1_59_0 \ #指定boost 文件存放路径
-DENABLED_LOCAL_INFILE=1 \ #启用本地加载数据
-DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock \ #指定mysql.sock文件路径
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
最后编辑于:2024-07-27 15:21:30
热门推荐
汽车电瓶寿命一般多久,如何能延长电瓶寿命?看看老司机怎么说?
推广“无陪护”病房,还需迈过几道关?
政策工具落地显效 如何让产业资本更耐心、更安心?
京C车牌价值探究:车牌背后的故事与市场价值分析
拿破仑战争的影响:重塑欧洲与全球政治格局
珠海外伶仃岛入选“中国最美十座小岛”,这里有最独特的海岛风光
终身寿险现金价值表怎么看?
优雅的恶魔:文学、哲学与心理学视角下的复杂人性探索
新手平面设计师的职业发展指南:三大核心能力助你快速成长
这五种超级食物,竟然是天然的“血糖调节器”!
利用电化学技术处理污水的可行性分析
学术:古典自由主义与新自由主义的比较
海南从三个方面优化完善2024中招政策
古代算命怎么算
TVB男星周嘉洛连拍两剧角色反差大,被偶遇大方合影,健身效果引赞叹
胰腺炎后期如何保养
铁腕书记陈行甲:反腐87名贪官后选择辞官
明朝的海外贸易与海上丝绸之路:历史的华章与时代的镜鉴
2024-2025 赛季 NBA 球队实力分级:王者之师、劲旅与新势力
DOTA 美杜莎命技能分析及装备选择推荐
陆游简介及作品《钗头凤》赏析
大正时代从婚姻枷锁到文学解放的柳原白莲
25.5万人的东北边防军,林彪为何推荐粟裕担任司令员?
抑郁症早晨心情差怎么办
五行缺木怎样才能旺起来,五行缺木的命理分析
1988年龙年运势全解析:2025年挑战与机遇并存
法医学家工作内容具体有哪些
绿色发展 | 走,去国家级绿色工厂看看⑧~
谨防非法集资,这些法律知识干货你必须知道!
多元宇宙:平行宇宙的科学解读