Simplify MariaDB installation script

This commit is contained in:
Disassembler 2019-02-27 13:46:24 +01:00
parent 6af3888fda
commit 180997be4a
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 1 additions and 11 deletions

View File

@ -6,7 +6,7 @@ cd $(realpath $(dirname "${0}"))/install
# Create MariaDB instance
mkdir -p /srv/mariadb/conf /srv/mariadb/data
chown 3306:3306 /srv/mariadb/data
lxc-execute mariadb -- mysql_install_db --user=mysql
lxc-execute mariadb -- mysql_install_db --user=mysql --datadir=/var/lib/mysql --auth-root-authentication-method=socket --skip-test-db
# Configure MariaDB
cp srv/mariadb/conf/my.cnf /srv/mariadb/conf/my.cnf
@ -19,8 +19,3 @@ fi
# Install service
cp etc/init.d/mariadb /etc/init.d/mariadb
rc-update -u
# Configure MariaDB admin
service mariadb start
cat adminpwd.sql | lxc-attach mariadb -- mysql
service mariadb stop

View File

@ -1,5 +0,0 @@
DELETE FROM mysql.user WHERE User != 'root' OR Host != 'localhost';
INSTALL PLUGIN unix_socket SONAME 'auth_socket';
UPDATE mysql.user SET plugin='unix_socket';
FLUSH PRIVILEGES;
DROP DATABASE IF EXISTS test;