- 下载安装包: https://dev.mysql.com/downloads/mysql/5.7.html
- 解压目录: /usr/src/mysql-5.7.36
- 安装依赖包: sudo port install ncurses libedit cyrus-sasl2 zlib openssl3 mysql_select make cmake pkgconfig
- 系统兼容处理
mv /usr/src/mysql-5.7.36/{MYSQL_,}VERSION sed -i '' 's|${CMAKE_SOURCE_DIR}/VERSION|${CMAKE_SOURCE_DIR}/MYSQL_VERSION|g' /usr/src/mysql-5.7.36/cmake/mysql_version.cmake
- 预编译
cmake . -DCMAKE_INSTALL_PREFIX=/opt/local\ -DMYSQL_DATADIR=/opt/local/var/db/mysql57\ -DDEFAULT_CHARSET=utf8\ -DDEFAULT_COLLATION=utf8_general_ci\ -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql\ -DWITH_MYISAM_STORAGE_ENGINE=1\ -DWITH_INNOBASE_STORAGE_ENGINE=1\ -DWITH_ARCHIVE_STORAGE_ENGINE=1\ -DWITH_BLACKHOLE_STORAGE_ENGINE=1\ -DWITH_MEMORY_STORAGE_ENGINE=1\ -DENABLE_DOWNLOADS=1\ -DDOWNLOAD_BOOST=1\ -DWITH_BOOST=/usr/src/mysql-5.7.36/boost\ -DWITH_SSL=/opt/local/libexec/openssl3
- 编译
make
- 安装
make install
参考:
发表评论
要发表评论,您必须先登录。