936,11 → 936,16 |
$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf |
$SED "s?^tmpdir.*?tmpdir=/tmp?g" /etc/my.cnf |
/usr/bin/systemctl start mysqld.service |
sleep 4 |
is_active=`systemctl is-active mysqld` |
if [ "$is_active" != "active" ] |
nb_round=1 |
while [ ! -f /var/run/mysqld/mysqld.pid ] && [ $nb_round -ne 10 ] # we wait until mariadb is on |
do |
nb_round=`expr $nb_round + 1` |
sleep 2 |
done |
if [ ! -f /var/run/mysqld/mysqld.pid ] |
then |
sleep 4 # we need to wait again (slow machine) |
echo "Problème : la base donnée ne s'est pas lancée ! " |
exit |
fi |
mysqladmin -u root password $mysqlpwd |
MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec" |