Mac下使用Clion调试MySQL版本5.7源码
【摘要】 环境
macOS Catalina clion2020.1 cmake boost
首先从 GitHub 获取 mysql 源码,直接通过 git pull 拉取代码。切换到 5.7 分支。
操作
生成目录
// 生成编译后安装目录及数据目录
mkdir -p build_out/data
12
编译
cmake . -DWITH_DEBUG=1 \
-D...
环境
macOS Catalina
clion2020.1
cmake
boost
首先从 GitHub 获取 mysql 源码,直接通过 git pull 拉取代码。切换到 5.7 分支。
操作
生成目录
// 生成编译后安装目录及数据目录
mkdir -p build_out/data
- 1
- 2
编译
cmake . -DWITH_DEBUG=1 \
-DCMAKE_INSTALL_PREFIX=build_out \
-DMYSQL_DATADIR=build_out/data
- 1
- 2
- 3
- 4
- 5
make && make install
- 1
初始化 mysql 数据库
cd build_out
➜ build_out git:(5.7) ✗ bin/mysql_install_db
2021-06-17 17:31:11 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2021-06-17 17:31:11 [ERROR] The data directory needs to be specified.
➜ build_out git:(5.7) ✗ mysqld --initialize
2021-06-17T09:31:12.953002Z 0 [System] [MY-013169] [Server] /usr/local/Cellar/mysql/8.0.21_1/bin/mysqld (mysqld 8.0.21) initializing of server in progress as process 61881
2021-06-17T09:31:12.956680Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2021-06-17T09:31:12.956688Z 0 [ERROR] [MY-013236] [Server] The designated data directory /usr/local/var/mysql/ is unusable. You can remove all files that the server added to it.
2021-06-17T09:31:12.956739Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-06-17T09:31:12.956911Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.21_1/bin/mysqld: Shutdown complete (mysqld 8.0.21) Homebrew.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
debug启动参数,并调试
客户端发起连接:
文章来源: javaedge.blog.csdn.net,作者:JavaEdge.,版权归原作者所有,如需转载,请联系作者。
原文链接:javaedge.blog.csdn.net/article/details/117997473
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)