下载源码
直接从github 上下载了源码。git 地址:https://github.com/mysql/mysql-server
下载路径如:/work/mysql-server
编译
依赖
mac系统依赖环境 cmake,boost
cmake 安装
brew install cmake
boost下载:https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
编译
##mysql目录
cd /work/mysql-server
mkdir build && cd build
执行cmake
cmake .. -DCMAKE_INSTALL_PREFIX=/Users/softwork/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNODB_MEMCACHED=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/work/mysql-server/mysql-server/boost/boost_1_72_0
DCMAKE_INSTALL_PREFIX为mysql的安装目录,自己指定,DWITH_BOOST为boost的下载路径
执行make
make & make install
增加my.cnf配置
[client]
port = 3306
socket = /Users/data/mysql/mysql.sock
[mysqld]
#My