当前位置:网站首页>MacOS下使用CLion编译调试MySQL8.x
MacOS下使用CLion编译调试MySQL8.x
2022-04-23 09:34:00 【筑梦之人】
基本环境
操作系统:MacOS Monterey(版本 12.2.1) M1 16GB内存
CLion 版本:CLion 2021.2.1
MySQL 版本:8.0
首先要确保系统装有cmake,如果没有需要提前按照,笔者采用的是brew按照:brew install cmake
CLion 调试配置
1、获取MySQL源码,笔者采用从github获取:[email protected]:mysql/mysql-server.git
2、创建构建代码存放路径,笔者选择存放在源码的build目录下
3、配置 CLion 的 Cmake 的编译目录
在CLion的Preference -> Build,Excution,Deployment -> CMake -> Build Directory选择创建的build目录
4、配置 CLion 的 Cmake 的编译参数
需要下载一个boost,笔者使用
https://nchc.dl.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.bz2
-DCMAKE_BUILD_TYPE=Debug
-DWITH_BOOST=/Users/zjw/Downloads/boost_1_73_0
-DCMAKE_INSTALL_PREFIX=/Users/zjw/OpenSource/mysql-server/build
#编译路径与安装路径需一致
-DMYSQL_DATADIR=/Users/zjw/OpenSource/mysql-server/build/data
#数据库初始化路径
-DSYSCONFDIR=/Users/zjw/OpenSource/mysql-server/build
-DMYSQL_UNIX_ADDR=/Users/zjw/OpenSource/mysql-server/build/data/mysql.sock
5、编译MySQL
Build -> Build Project
6、数据库初始化
需求确保系统有mysql组和mysql用户
cd /Users/zjw/OpenSource/mysql-server/build
./mysqld --basedir=/Users/zjw/OpenSource/mysql-server/build \
--datadir=/Users/zjw/OpenSource/mysql-server/build/data \
--initialize-insecure --user=mysql
7、建立数据存放目录,并修改文件权限
mkdir build/data
chmod -R 777 /Users/zjw/OpenSource/mysql-server/build/data
8、配置mysqld启动参数(program arguments)
--basedir=/Users/zjw/OpenSource/mysql-server/build --datadir=/Users/zjw/OpenSource/mysql-server/build/data --user=mysql
9、指定数据目录(working directory)
/Users/zjw/OpenSource/mysql-server/build/data
至此调试环境搭建完成
版权声明
本文为[筑梦之人]所创,转载请带上原文链接,感谢
https://blog.csdn.net/co_zjw/article/details/124256480
边栏推荐
- AQS & reentrantlock implementation principle
- Flutter 的加载动画这么玩更有趣
- Random neurons and random depth of dropout Technology
- Wechat applet catchtap = "todetail" event problem
- Set the maximum width of the body, but why does the background color of the body cover the whole page?
- Creation of raid0 and RAID5 and Simulation of how RAID5 works
- JS prototype chain
- Where is int a = 1 stored
- NLLLoss+log_ SoftMax=CE_ Loss
- NPM installation yarn
猜你喜欢

Kernel PWN learning (3) -- ret2user & kernel ROP & qwb2018 core

What is monitoring intelligent playback and how to use intelligent playback to query video recording

npm ERR! network

Node installation

Number of islands

kettle实验

501. Mode in binary search tree
![Sql1 [geek challenge 2019]](/img/ad/afca09bc1da003393319af700e90e3.png)
Sql1 [geek challenge 2019]

SAP debug debug for in, reduce and other complex statements

GoLand debug go use - white record
随机推荐
Two methods of building Yum source warehouse locally
Wechat applet catchtap = "todetail" event problem
Dropout技术之随机神经元与随机深度
Learn FPGA (from Verilog to HLS)
Flink 流批一体在小米的实践
Redis expired key cleaning and deletion policy summary
golang力扣leetcode 396.旋转函数
Leetcode-199 - right view of binary tree
Cloud computing competition -- basic part of 2020 competition [task 3]
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
Redis 异常 read error on connection 解决方案
考研线性代数常见概念、问题总结
Using JS to realize a thousandth bit
Leetcode0587. Install fence
NPM reports an error: operation not allowed, MKDIR 'C: \ program files \ node JS \ node_ cache _ cacache’
MySQL of database -- Fundamentals
ASUS laptop can't read USB and surf the Internet after reinstalling the system
DVWA range practice record
Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
SAP 03-amdp CDs table function using 'with' clause