#!/bin/bash -x # Repo URL taken from https://www.linuxcapable.com/how-to-install-mariadb-on-ubuntu-linux/ BASEURL=https://ukr.pw export DEBIAN_FRONTEND=noninteractive apt-get update apt-get -y install gnupg curl -fsSL http://mirror.mariadb.org/PublicKey_v2 | sudo gpg --dearmor -o /usr/share/keyrings/mariadb.gpg if [ "x`uname -m`" == "xx86_64" ]; then echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/mariadb.gpg] http://mirror.mariadb.org/repo/10.11/ubuntu/ jammy main' >> /etc/apt/sources.list else echo 'deb [arch=arm64 signed-by=/usr/share/keyrings/mariadb.gpg] http://mirror.mariadb.org/repo/10.11/ubuntu/ jammy main' >> /etc/apt/sources.list fi apt-get update apt-get -y install mariadb-server service mysql stop rm -f /etc/mysql/my.cnf wget -O /etc/mysql/my.cnf $BASEURL/ub/my.cnf.1G.txt rm -rf /var/lib/mysql/* mysql_install_db service mysql start if [ ! -x /bin/gp ]; then wget -O /bin/gp $BASEURL/gp.txt chmod 755 /bin/gp fi MSLRTPW=`gp 16` wget -O - $BASEURL/mysql/setpw.mariadb105.txt | sed -e "s/PWPWPW/$MSLRTPW/" | mysql mysql echo echo echo "MySQL root password is $MSLRTPW" echo echo echo $MSLRTPW > /root/.pass.my echo echo "[client]" > /root/.my.cnf echo "user=root" >> /root/.my.cnf echo "password=$MSLRTPW" >> /root/.my.cnf