Skip to content

Instantly share code, notes, and snippets.

@fjbardelli
Forked from michfield/mysql56-install.sh
Last active December 23, 2015 15:29
Show Gist options
  • Save fjbardelli/6656067 to your computer and use it in GitHub Desktop.
Save fjbardelli/6656067 to your computer and use it in GitHub Desktop.
# wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-server-5.7.2_m12-1.el6.x86_64.rpm
# wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-client-5.7.2_m12-1.el6.x86_64.rpm
# wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-shared-5.7.2_m12-1.el6.x86_64.rpm
wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-server-5.7.2_m12-1.el6.i686.rpm
wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-client-5.7.2_m12-1.el6.i686.rpm
wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-shared-5.7.2_m12-1.el6.i686.rpm
wget https://secure.logmein.com/labs/logmein-hamachi_2.1.0.119-1_amd64.deb
apt-get install -y lsb-core
dpkg –i logmein-hamachi_2.1.0.119-1_amd64.deb
apt-get -f install
cd /opt/
wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-server-5.7.2_m12-1.el6.x86_64.rpm
wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-client-5.7.2_m12-1.el6.x86_64.rpm
wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-shared-5.7.2_m12-1.el6.x86_64.rpm
#yum -y install libaio-devel
#yum -y install perl
#rpm -ivh MySQL-server-5.7.2_m12-1.el6.x86_64.rpm
#rpm -ivh MySQL-client-5.7.2_m12-1.el6.x86_64.rpm
#rpm -ivh MySQL-shared-5.7.2_m12-1.el6.x86_64.rpm
#/etc/init.d/mysql start
#/usr/bin/mysql_secure_installation
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "***********************************************************************"
echo "* *"
echo "* Ubuntu MONO Server Install v0.5 *"
echo "* ------------------------------------------------------------- *"
echo "* This script will build and install the latest stable version of *"
echo "* mono [3.2.1] and install nginx, fastcgi-mono-server4 to run .net 4 *"
echo "* applications. *"
echo "* This operation can take a while as it will download compile and *"
echo "* install from source on most packages. *"
echo "* *"
echo "**********************************************************************"
echo "WARNING! This will overwrite your existing mono setup,uninstall Apache and install nginx, Would you like to continue?"
select yn in "Yes" "No"; do
case $yn in
Yes )
echo "make sure apt-get is updated"
apt-get updat
echo "remove packages that are no longer needed"
apt-get -y autoremove
echo "Installing git"
apt-get -y install git
echo "Installing prereqs for compiling"
apt-get -y install autoconf automake libtool make pkg-config libgtk2.0-dev
echo "Installing Ubuntu packages"
apt-get -q -y install build-essential mono-gmcs libglib2.0-dev libpango1.0-dev libatk1.0-dev libglade2-dev libart-2.0-dev
apt-get -q -y install libgnomevfs2-dev libgnome2-dev libgnomecanvas2-dev libgnomeui-dev libmono-addins-cil-dev libmono-addins-gui-cil-dev wget unzip
echo "Cloning GDI source, compiling and installing."
cd /opt
mkdir mono
cd mono
echo "Cloning libgdiplus, compiling and installing"
git clone git://github.com/mono/libgdiplus.git
cd libgdiplus
./autogen.sh --prefix=/usr
make
make install
cd ..
echo "Cloning Mono source, compiling and installing"
git clone git://github.com/mono/mono.git
cd mono
git checkout mono-3.2.3
./autogen.sh --prefix=/usr
make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
make install
cd ..
echo "Cloning gtk-sharp, compiling and installing"
git clone git://github.com/mono/gtk-sharp.git
cd gtk-sharp
git checkout gtk-sharp-2-12-branch
./bootstrap-2.12 --prefix=/usr
make
make install
cd ..
echo "Cloning gnome-sharp, compiling and installing"
git clone git://github.com/mono/gnome-sharp.git
cd gnome-sharp
git checkout master
./bootstrap-2.24 --prefix=/usr
make
make install
cd ..
echo "Cloning XSP, source compile and installing"
git clone git://github.com/mono/xsp.git
cd xsp
git checkout 3.0.11
./autogen.sh --prefix=/usr
make
make install
cd ..
echo "Cloning fsharp, source compile and installing"
git clone --progress https://github.com/fsharp/fsharp.git
cd fsharp
git checkout 3.0.27
./autogen.sh --prefix=/usr
make
make install
cd ..
echo "===================================================="
echo " Cloning MonoDevelop, source compile and installing "
echo "===================================================="
git clone --progress git://github.com/mono/monodevelop.git
cd monodevelop
git checkout monodevelop-4.1.10
git submodule init
git submodule update
./configure
make
make install
cd ..
break;;
No ) echo "OK bye."; exit;;
esac
done
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "***********************************************************************"
echo "* *"
echo "* Ubuntu MONO Server Install v0.5 *"
echo "* ------------------------------------------------------------- *"
echo "* This script will build and install the latest stable version of *"
echo "* mono [3.2.1] and install nginx, fastcgi-mono-server4 to run .net 4 *"
echo "* applications. *"
echo "* This operation can take a while as it will download compile and *"
echo "* install from source on most packages. *"
echo "* *"
echo "**********************************************************************"
echo "make sure apt-get is updated"
apt-get updat
echo "remove packages that are no longer needed"
apt-get -y autoremove
echo "Installing git"
apt-get -y install git
echo "Installing prereqs for compiling"
apt-get -y install autoconf automake libtool make pkg-config libgtk2.0-dev
echo "Installing Ubuntu packages"
apt-get -q -y install build-essential mono-gmcs libglib2.0-dev libpango1.0-dev libatk1.0-dev libglade2-dev libart-2.0-dev
apt-get -q -y install libgnomevfs2-dev libgnome2-dev libgnomecanvas2-dev libgnomeui-dev libmono-addins-cil-dev libmono-addins-gui-cil-dev wget unzip
echo "Cloning GDI source, compiling and installing."
cd /opt
mkdir mono
cd mono
echo "Cloning libgdiplus, compiling and installing"
git clone git://github.com/mono/libgdiplus.git
cd libgdiplus
./autogen.sh --prefix=/usr
make
make install
cd ..
echo "Cloning Mono source, compiling and installing"
git clone git://github.com/mono/mono.git
cd mono
git checkout mono-3.2.3
./autogen.sh --prefix=/usr
make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
make install
cd ..
echo "Cloning gtk-sharp, compiling and installing"
git clone git://github.com/mono/gtk-sharp.git
cd gtk-sharp
git checkout gtk-sharp-2-12-branch
./bootstrap-2.12 --prefix=/usr
make
make install
cd ..
echo "Cloning gnome-sharp, compiling and installing"
git clone git://github.com/mono/gnome-sharp.git
cd gnome-sharp
git checkout master
./bootstrap-2.24 --prefix=/usr
make
make install
cd ..
echo "Cloning XSP, source compile and installing"
git clone git://github.com/mono/xsp.git
cd xsp
git checkout 3.0.11
./autogen.sh --prefix=/usr
make
make install
cd ..
echo "Cloning fsharp, source compile and installing"
git clone --progress https://github.com/fsharp/fsharp.git
cd fsharp
git checkout 3.0.27
./autogen.sh --prefix=/usr
make
make install
cd ..
#!/usr/bin/env bash
#
# Install MySQL server
#
# Author:
# Colovic Vladan, First Beat Media
#
download_dir=/srv/tmp/download
download_url=http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/
mysql_deb=$download_dir/mysql-5.6-x86_64.deb
_kill_mysql() {
# Consider using `killall -r mysqld`
#
ps -ef | grep -iE "mysqld" | grep -ivE "grep"
if [ $? -eq 0 ] ; then
ps -ef | grep -iE "mysqld" | grep -ivE "grep" | awk '{print $2}' | xargs sudo kill -9
fi
}
mkdir -p $download_dir
echo "Remove 5.5 package"
apt-get remove mysql-server mysql-server-5.5 mysql-server-core-5.5
echo "Downloading package..."
test -f "$mysql_deb" || wget --quiet $download_url -O $mysql_deb
echo "Stop MySQL server..."
sudo service mysql stop
# Just in case, ensure any mysql is cleaned from memory
_kill_mysql
# The libaio library, which has been used since MySQL 5.5.4, is now
# linked into mysqld dynamically rather than statically. It needs to be
# already on your Linux system.
#
echo "Installing package 'libaio'..."
apt-get -y -qq install libaio1
echo "Installing MySQL 5.6..."
dpkg -i $mysql_deb
echo "Adding mysql user & group..."
groupadd mysql
useradd -r -g mysql mysql
# Include the settings immediatly
. /etc/profile.d/mysql-server.sh
cd /opt/mysql/server-5.6
chown -R mysql .
chgrp -R mysql .
echo "Initialize data..."
scripts/mysql_install_db --user=mysql >/dev/null
chown -R root .
chown -R mysql data
cp support-files/mysql.server /etc/init.d/mysql
echo "Temporary MySQL instance opened to everyone..."
echo -e "[mysqld]\nskip-grant-tables" >/etc/mysql/conf.d/skip_grant_tables.cnf
service mysql restart
echo "Setting root password..."
mysql -u root \
-e "UPDATE mysql.user SET Password=PASSWORD('yourpass') WHERE User='root';" \
-e "FLUSH PRIVILEGES;"
rm -rf /etc/mysql/conf.d/skip_grant_tables.cnf
echo "Now restart MySQL server as normal..."
service mysql restart
# I did this in two steps on purpose
echo "Secure the whole installation..."
mysql -u root --password=yourpass \
-e "DELETE FROM mysql.user WHERE User='';" \
-e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" \
-e "DROP DATABASE test;" \
-e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';" \
-e "FLUSH PRIVILEGES;"
echo "Include shared libraries"
echo "/opt/mysql/server-5.6/lib" > /etc/ld.so.conf.d/mysql.conf
ldconfig
echo "Finished installing MySQL."
#!/usr/bin/env bash
#
# Install MySQL server
#
# Author:
# Colovic Vladan, First Beat Media
#
download_dir=/srv/tmp/download
download_url=http://www.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.2-m12-debian6.0-x86_64.deb/from/http://cdn.mysql.com/
mysql_deb=$download_dir/mysql-5.7-x86_64.deb
_kill_mysql() {
# Consider using `killall -r mysqld`
#
ps -ef | grep -iE "mysqld" | grep -ivE "grep"
if [ $? -eq 0 ] ; then
ps -ef | grep -iE "mysqld" | grep -ivE "grep" | awk '{print $2}' | xargs sudo kill -9
fi
}
mkdir -p $download_dir
echo "Remove 5.5 package"
apt-get remove mysql-server mysql-server-5.5 mysql-server-core-5.5
echo "Downloading package..."
test -f "$mysql_deb" || wget $download_url -O $mysql_deb
echo "Stop MySQL server..."
sudo service mysql stop
# Just in case, ensure any mysql is cleaned from memory
_kill_mysql
# The libaio library, which has been used since MySQL 5.5.4, is now
# linked into mysqld dynamically rather than statically. It needs to be
# already on your Linux system.
#
echo "Installing package 'libaio'..."
apt-get -y -qq install libaio1
echo "Installing MySQL 5.7..."
dpkg -i $mysql_deb
echo "Adding mysql user & group..."
groupadd mysql
useradd -r -g mysql mysql
# Include the settings immediatly
. /etc/profile.d/mysql-server.sh
cd /opt/mysql/server-5.7
chown -R mysql .
chgrp -R mysql .
echo "Initialize data..."
scripts/mysql_install_db --user=mysql >/dev/null
chown -R root .
chown -R mysql data
cp support-files/mysql.server /etc/init.d/mysql
echo "Temporary MySQL instance opened to everyone..."
echo -e "[mysqld]\nskip-grant-tables" >/etc/mysql/conf.d/skip_grant_tables.cnf
service mysql restart
echo "Setting root password..."
mysql -u root \
-e "UPDATE mysql.user SET Password=PASSWORD('yourpass') WHERE User='root';" \
-e "FLUSH PRIVILEGES;"
rm -rf /etc/mysql/conf.d/skip_grant_tables.cnf
echo "Now restart MySQL server as normal..."
service mysql restart
# I did this in two steps on purpose
echo "Secure the whole installation..."
mysql -u root --password=yourpass \
-e "DELETE FROM mysql.user WHERE User='';" \
-e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" \
-e "DROP DATABASE test;" \
-e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';" \
-e "FLUSH PRIVILEGES;"
echo "Include shared libraries"
echo "/opt/mysql/server-5.7/lib" > /etc/ld.so.conf.d/mysql.conf
ldconfig
echo "Finished installing MySQL."
apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.650_all.deb
sudo dpkg --install webmin_1.650_all.deb
#apt-get -f install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment