SCRIPT_DIR=$(cd $(dirname $0) && pwd)
source $SCRIPT_DIR/1506004727_mybase
echo "Attempting to start mysqld (socket /dev/shm/1506004727/socket.sock)..."
if [ "${JEMALLOC}" != "" -a -r "${JEMALLOC}" ]; then export LD_PRELOAD=${JEMALLOC}
elif [ -r `sudo find /usr/lib/ /usr/lib64/ /usr/libexec/ -name libjemalloc.so.1 | head -n1` ]; then export LD_PRELOAD=`sudo find /usr/lib/ /usr/lib64/ /usr/libexec/ -name libjemalloc.so.1 | head -n1`
elif [ -r ${BASEDIR}/lib/mysql/libjemalloc.so.1 ]; then export LD_PRELOAD=${BASEDIR}/lib/mysql/libjemalloc.so.1
else echo 'Warning: jemalloc was not loaded as it was not found (this is fine for MS, but do check ./1506004727_mybase to set correct jemalloc location for PS)'; fi
BIN=`find ${BASEDIR} -maxdepth 2 -name mysqld -type f -o -name mysqld-debug -type f | head -1`;if [ -z $BIN ]; then echo "Assert! mysqld binary '$BIN' could not be read";exit 1;fi
 $BIN --no-defaults --basedir=${BASEDIR} --datadir=/dev/shm/1506004727/data --tmpdir=/dev/shm/1506004727/tmp --port=39863 --pid-file=/dev/shm/1506004727/pid.pid --core-file --socket=/dev/shm/1506004727/socket.sock --innodb-force-recovery=2047 --log-error=/dev/shm/1506004727/error.log.out > /dev/shm/1506004727/mysqld.out 2>&1 &
