* Fri Apr 04 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- restore root user, pasword and socket login [SME: 12978]
This commit is contained in:
@@ -3,9 +3,13 @@
|
||||
exec 2>&1
|
||||
if [ ! -f /var/lib/mysql/mysql/user.frm ]
|
||||
then
|
||||
setuidgid mysql sh /usr/bin/mysql_install_db --rpm --skip-test-db --user=mysql --group=mysql
|
||||
setuidgid mysql sh /usr/bin/mariadb-install-db --rpm --skip-test-db --user=mysql --group=mysql
|
||||
if [ -f /home/e-smith/db/mysql/mysql.dump ]
|
||||
then
|
||||
/sbin/e-smith/expand-template /etc/e-smith/sql/init/00_restore_dumped_dbs
|
||||
fi
|
||||
fi
|
||||
|
||||
# set root password and access to socket passwordless
|
||||
/usr/sbin/mariadbd --socket=/var/lib/mysql/mysql.sock --bootstrap --user=mysql < /var/lib/mysql.private/set.password
|
||||
exit 0
|
||||
|
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(seq 1 20);
|
||||
do
|
||||
if [ -S /var/lib/mysql/mysql.sock ]
|
||||
then
|
||||
/usr/bin/mysql < /var/lib/mysql.private/set.password
|
||||
echo "root password set"
|
||||
exit 0
|
||||
fi
|
||||
echo waiting for mariadb to start to set root password
|
||||
sleep 1
|
||||
done
|
||||
echo failed to set root password
|
||||
# we fail silently, mariadb will still work, only issue is for phpmyadmin
|
||||
# and non socket access
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user