#!/bin/bash -x # # https://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 | sudo tee /usr/share/keyrings/mariadb.gpg > /dev/null echo "deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/mariadb.gpg] http://mirror.mariadb.org/repo/11.4/ubuntu/ $(lsb_release -cs) main" >> /etc/apt/sources.list apt-get update apt-get -y install mariadb-server service mariadb stop rm -f /etc/mysql/my.cnf wget -O /etc/mysql/my.cnf $BASEURL/ub/my.cnf.1G.txt rm -rf /var/lib/mysql/* mariadb-install-db service mariadb 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/" | mariadb 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