您当前的位置: 首页 >  sql

Mac下使用Clion调试MySQL版本5.7源码

发布时间:2021-06-17 17:03:28 ,浏览量:0

环境

macOS Catalina clion2020.1 cmake boost

首先从 GitHub 获取 mysql 源码,直接通过 git pull 拉取代码。切换到 5.7 分支。

操作 生成目录
// 生成编译后安装目录及数据目录 mkdir -p build_out/data
编译
cmake . -DWITH_DEBUG=1 \ -DCMAKE_INSTALL_PREFIX=build_out \ -DMYSQL_DATADIR=build_out/data 

make && make install

初始化 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. 

debug启动参数,并调试

客户端发起连接:

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    115984博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.1089s