#!/bin/bash #Instalacja serwera baz danych sudo apt -y install mariadb-server mariadb-client #Konfiguracja serwera baz danych (wykonanie m.in. "mysql_secure_installation") sudo mysql -e "UPDATE mysql.user SET Password = PASSWORD('Zaq12wsx') WHERE User = 'root'" sudo mysql -e "DELETE FROM mysql.user WHERE User='';" sudo mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1', '10.10.0.2');" sudo mysql -e "DROP DATABASE IF EXISTS test;" sudo mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';" sudo mysql -e "use mysql; update user set plugin='' where User='root';" sudo mysql -u root -e "CREATE DATABASE IF NOT EXISTS baza_test;" sudo mysql -e "flush privileges;"