Skip to content

Instantly share code, notes, and snippets.

@zolem
Last active November 26, 2021 11:47
Show Gist options
  • Save zolem/79ba01fd3deb130b851d to your computer and use it in GitHub Desktop.
Save zolem/79ba01fd3deb130b851d to your computer and use it in GitHub Desktop.
Install phpmyadmin
echo "Installing pwgen..."
sudo apt-get install pwgen -y
AUTO_GENERATED_PASS=`pwgen -c -1 20`
echo "Installing phpmyadmin..."
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean true"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-user string root"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password root"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password $AUTO_GENERATED_PASS"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/app-password-confirm password $AUTO_GENERATED_PASS"
sudo apt-get install phpmyadmin -y
sudo php5enmod mcrypt
sudo service apache2 reload
echo "phpmyadmin installed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment