前置准备
MYSQL源码
下载地址:https://dev.mysql.com/downloads/file/?id=508115
注:下载时请下载Includes Boost Headers,不然还需另外下载被墙原因耗时比较长。IDE
CLIONBrew (下载相关依赖库及环境)
下载Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
更换镜像:
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
依赖配置
openssl gcc cmake
brew install openssl
brew install gcc
brew install cmake
openssl由于macos自带openssl,所以需要更换为新下载的openssl
步骤:
brew upgrade openssl
brew link openssl --force
cmake
导入项目到clion
cmake . -DCMAKE_INSTALL_PREFIX=./build_out -DWITH_DEBUG=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/Users/wuhongda/whd/ -DWITH_BOOST=/Users/wuhongda/whd/
Install
initialize
install后在build输出目录就存在bin文件,现在开始初始化数据目录
--initialize --user=mysql --console --basedir=/Users/wuhongda/whd/build_out --datadir=/Users/wuhongda/whd/build_out/data
debug
--basedir=/Users/wuhongda/whd/build_out --datadir=/Users/wuhongda/whd/build_out/data/