Skip to content

Instantly share code, notes, and snippets.

@logbasex
Forked from sheikhwaqas/setup-mysql.sh
Created June 13, 2020 19:48
Show Gist options
  • Save logbasex/c229e3b5670e61b150beb9924e4c8fba to your computer and use it in GitHub Desktop.
Save logbasex/c229e3b5670e61b150beb9924e4c8fba to your computer and use it in GitHub Desktop.

Revisions

  1. @sheikhwaqas sheikhwaqas revised this gist Jul 4, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-mysql.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ ufw allow 22
    ufw allow 3306

    # Install essential packages
    apt-get -y install zsh curl htop
    apt-get -y install zsh htop

    # Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
    echo "mysql-server-5.6 mysql-server/root_password password root" | sudo debconf-set-selections
  2. @sheikhwaqas sheikhwaqas revised this gist Jul 4, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup-mysql.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ ufw allow 22
    ufw allow 3306

    # Install essential packages
    apt-get -y install gcc g++ autoconf automake make sendmail git zsh curl htop
    apt-get -y install zsh curl htop

    # Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
    echo "mysql-server-5.6 mysql-server/root_password password root" | sudo debconf-set-selections
  3. @sheikhwaqas sheikhwaqas revised this gist May 9, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions setup-mysql.sh
    Original file line number Diff line number Diff line change
    @@ -14,9 +14,9 @@ ufw allow 3306
    apt-get -y install gcc g++ autoconf automake make sendmail git zsh curl htop

    # Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
    echo "mysql-server-5.5 mysql-server/root_password password root" | sudo debconf-set-selections
    echo "mysql-server-5.5 mysql-server/root_password_again password root" | sudo debconf-set-selections
    apt-get -y install mysql-server-5.5
    echo "mysql-server-5.6 mysql-server/root_password password root" | sudo debconf-set-selections
    echo "mysql-server-5.6 mysql-server/root_password_again password root" | sudo debconf-set-selections
    apt-get -y install mysql-server-5.6


    # Run the MySQL Secure Installation wizard
  4. @sheikhwaqas sheikhwaqas created this gist Feb 19, 2014.
    28 changes: 28 additions & 0 deletions setup-mysql.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    # Download and Install the Latest Updates for the OS
    apt-get update && apt-get upgrade -y

    # Set the Server Timezone to CST
    echo "America/Chicago" > /etc/timezone
    dpkg-reconfigure -f noninteractive tzdata

    # Enable Ubuntu Firewall and allow SSH & MySQL Ports
    ufw enable
    ufw allow 22
    ufw allow 3306

    # Install essential packages
    apt-get -y install gcc g++ autoconf automake make sendmail git zsh curl htop

    # Install MySQL Server in a Non-Interactive mode. Default root password will be "root"
    echo "mysql-server-5.5 mysql-server/root_password password root" | sudo debconf-set-selections
    echo "mysql-server-5.5 mysql-server/root_password_again password root" | sudo debconf-set-selections
    apt-get -y install mysql-server-5.5


    # Run the MySQL Secure Installation wizard
    mysql_secure_installation

    sed -i 's/127\.0\.0\.1/0\.0\.0\.0/g' /etc/mysql/my.cnf
    mysql -uroot -p -e 'USE mysql; UPDATE `user` SET `Host`="%" WHERE `User`="root" AND `Host`="localhost"; DELETE FROM `user` WHERE `Host` != "%" AND `User`="root"; FLUSH PRIVILEGES;'

    service mysql restart