Skip to content

Instantly share code, notes, and snippets.

@jaircuevajunior
Last active September 14, 2018 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jaircuevajunior/13909e43607552cec100621b7ce66813 to your computer and use it in GitHub Desktop.
Save jaircuevajunior/13909e43607552cec100621b7ce66813 to your computer and use it in GitHub Desktop.
Compile MySQL 5.7 from source
  1. Download build-tools
apt-get install build-essential cmake -y
  1. Configure the compiler
cmake \
-DWITH_BOOST=/usr/local/src/mysql-5.7.19/boost/boost_1_59_0 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DMYSQL_UNIX_ADDR=/tmp/mysql57.sock \
-DMYSQL_DATADIR=/usr/local/mysql57/data \
-DSYSCONFDIR=/usr/local/mysql57/etc \
  1. Make Install
make install
  1. Create default database
mkdir /usr/local/mysql57/data
chown mysql:mysql /usr/local/mysql57/data
mkdir /var/run/mysql57
chown mysql:mysql /var/run/mysql57
./bin/mysqld --port=3307 --datadir=/usr/local/mysql57/data --socket=/var/run/mysql57/mysql57.sock --initialize

Note the password at: /var/log/mysql/error.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment