Skip to content

Instantly share code, notes, and snippets.

@pquimo
Created February 24, 2021 17:12
Show Gist options
  • Save pquimo/7623184dd229dfbb50f3c0fcd1d6923c to your computer and use it in GitHub Desktop.
Save pquimo/7623184dd229dfbb50f3c0fcd1d6923c to your computer and use it in GitHub Desktop.
compiling mysql 8 on M1 mac
I have everything going into /opt/frog, but any path will work as long as you don't need sudo to write to it.
First, we need to compile openssl and cmake as they will be used during the compilation of mysql.
### openssl 1.1.1i
cd /opt/frog/src
curl --remote-name https://www.openssl.org/source/openssl-1.1.1i.tar.gz
tar xf openssl-1.1.1i.tar.gz
cd openssl-1.1.1i
./configure darwin64-arm64-cc --prefix=/opt/frog/openssl-1.1.1i
make depend
make
make install
ln -s /opt/frog/openssl-1.1.1i /opt/frog/openssl
### cmake 3.19.5
cd /opt/frog/src
# download source from https://cmake.org/download/ -- not sure how to get a simple working url
tar xf cmake-3.19.5.tar.gz
cd cmake-3.19.5
./bootstrap --prefix=/opt/frog/cmake-3.19.5
make
make install
ln -s /opt/frog/cmake-3.19.5 /opt/frog/cmake
### mysql 8.0.23
cd /opt/frog/src
curl --remote-name --location https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.23.tar.gz
tar xf mysql-8.0.23.tar.gz
mkdir build_mysql-8.0.23
cmake -DCMAKE_INSTALL_PREFIX=/opt/frog/mysql-8.0.23 -DDOWNLOAD_BOOST=ON -DWITH_BOOST=/opt/frog/src/boost -DWITH_SSL=/opt/frog/openssl -S mysql-8.0.23 -B build_mysql-8.0.23
cd build_mysql-8.0.23
make
make install
ln -s /opt/frog/mysql-8.0.23 /opt/frog/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment