Skip to content

Instantly share code, notes, and snippets.

@futeng
Created May 23, 2017 14:24
Show Gist options
  • Save futeng/bd45c448564a57df14b5cceac88986eb to your computer and use it in GitHub Desktop.
Save futeng/bd45c448564a57df14b5cceac88986eb to your computer and use it in GitHub Desktop.
#!/bin/bash
# name: mgr-init.sh
# author: ifuteng@gmail.com
# date: 2017/05/23
if [ -z "$1"]; then
echo "port should not be empty!"
exit 1
fi
mkdir /opt/apps
mv ./mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz /opt/apps
tar zxvf /opt/apps/mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /opt/apps
ln -s /opt/apps/mysql-5.7.18-linux-glibc2.5-x86_64 /usr/local/mysql
mkdir -p /data/mysql/mysql_$1/{data,logs,tmp}
chown -R mysql.mysql /data/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment