SCRIPT_DIR=$(cd $(dirname $0) && pwd)
source $SCRIPT_DIR/1455858251_mybase
echo "Attempting to start mysqld (socket /dev/shm/1455858251/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 ${MYBASE}/lib/mysql/libjemalloc.so.1 ]; then export LD_PRELOAD=${MYBASE}/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 ./1455858251_mybase to set correct jemalloc location for PS)'; fi
BIN=`find ${MYBASE} -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=${MYBASE} --datadir=/dev/shm/1455858251/data --tmpdir=/dev/shm/1455858251/tmp --port=36243 --pid-file=/dev/shm/1455858251/pid.pid --core-file --socket=/dev/shm/1455858251/socket.sock --log-error=/dev/shm/1455858251/error.log.out --event-scheduler=ON > /dev/shm/1455858251/mysqld.out 2>&1 &
