I have vm deployed and ssh into it. When I run tutor local init
I got the following error:
MySQL initialisation error
Error: Command failed with status 1: docker compose -f /home/rizary/.local/share/tutor/env/local/docker-compose.yml -f /home/rizary/.local/share/tutor/env/local/docker-compose.prod.yml -f /home/rizary/.local/share/tutor/env/local/docker-compose.tmp.yml --project-name tutor_local -f /home/rizary/.local/share/tutor/env/local/docker-compose.jobs.yml -f /home/rizary/.local/share/tutor/env/local/docker-compose.jobs.tmp.yml run --rm mysql-job sh -e -c echo "Initialising MySQL..."
mysql_connection_max_attempts=10
mysql_connection_attempt=0
until mysql -u root --password="cwhkorqN" --host "mysql" --port 3306 -e 'exit'
do
mysql_connection_attempt=$(expr $mysql_connection_attempt + 1)
echo " [$mysql_connection_attempt/$mysql_connection_max_attempts] Waiting for MySQL service (this may take a while)..."
if [ $mysql_connection_attempt -eq $mysql_connection_max_attempts ]
then
echo "MySQL initialisation error" 1>&2
exit 1
fi
sleep 10
done
echo "MySQL is up and running"
# edx-platform database
mysql -u root --password="cwhkorqN" --host "mysql" --port 3306 -e "CREATE DATABASE IF NOT EXISTS openedx;"
mysql -u root --password="cwhkorqN" --host "mysql" --port 3306 -e "CREATE USER IF NOT EXISTS 'openedx';"
mysql -u root --password="cwhkorqN" --host "mysql" --port 3306 -e "ALTER USER 'openedx'@'%' IDENTIFIED BY 'zsyOHpXc';"
mysql -u root --password="cwhkorqN" --host "mysql" --port 3306 -e "GRANT ALL ON openedx.* TO 'openedx'@'%';"
When I check the logs using docker logs <container>
I got the following message:
2022-11-24 22:34:32+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.35-1debian10 started.
2022-11-24 22:34:32+00:00 [Note] [Entrypoint]: Initializing database files
mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (Errcode: 13 - Permission denied)
2022-11-24T22:34:32.397655Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-11-24T22:34:32.399532Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
2022-11-24T22:34:32.399763Z 0 [ERROR] Aborting