SCRIPT_DIR=$(cd $(dirname $0) && pwd)
source $SCRIPT_DIR/1475058721_mybase
echo "Attempting to start mysqld (socket /dev/shm/1475058721/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 ./1475058721_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/1475058721/data --tmpdir=/dev/shm/1475058721/tmp --port=35222 --pid-file=/dev/shm/1475058721/pid.pid --core-file --socket=/dev/shm/1475058721/socket.sock --log-error=/dev/shm/1475058721/error.log.out --event-scheduler=ON > /dev/shm/1475058721/mysqld.out 2>&1 &
