MySQL initialisation error

I’m seeing the same error, but the above steps didn’t work to fix it. I’m also on a Mac, running Monterrey. System info:

Tutor: tutor, version 13.1.5

Docker:
4.5.0 (74594)
Engine: 20.10.12
Compose: v2.2.3
Credential Helper: 0.6.4
Kubernetes: v1.22.5
Snyk: v1.827.0

Error text:

================================================
        Database creation and migrations
================================================
Initialising all services...
Initialising mysql...
docker-compose -f /Users/robert/Library/Application Support/tutor/env/local/docker-compose.yml -f /Users/robert/Library/Application Support/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /Users/robert/Library/Application Support/tutor/env/local/docker-compose.jobs.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="6x6Z798Q" --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="6x6Z798Q" --host "mysql" --port 3306 -e 'CREATE DATABASE IF NOT EXISTS openedx;'
mysql -u root --password="6x6Z798Q" --host "mysql" --port 3306 -e 'GRANT ALL ON openedx.* TO "openedx"@"%" IDENTIFIED BY "GbPk5Yjd";'
[+] Running 1/0
 ⠿ Container tutor_local-mysql-1  Running                                            0.0s
Initialising MySQL...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [1/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [2/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [3/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [4/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [5/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [6/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [7/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [8/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [9/10] Waiting for MySQL service (this may take a while)...
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.18.0.13' is not allowed to connect to this MySQL server
    [10/10] Waiting for MySQL service (this may take a while)...
MySQL initialisation error
Error: Command failed with status 1: docker-compose -f /Users/robert/Library/Application Support/tutor/env/local/docker-compose.yml -f /Users/robert/Library/Application Support/tutor/env/local/docker-compose.prod.yml --project-name tutor_local -f /Users/robert/Library/Application Support/tutor/env/local/docker-compose.jobs.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="6x6Z798Q" --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="6x6Z798Q" --host "mysql" --port 3306 -e 'CREATE DATABASE IF NOT EXISTS openedx;'
mysql -u root --password="6x6Z798Q" --host "mysql" --port 3306 -e 'GRANT ALL ON openedx.* TO "openedx"@"%" IDENTIFIED BY "GbPk5Yjd";'

I’ve also seen the error ERROR 2003 (HY000): Can't connect to MySQL server on 'mysql' (111), but this seemed to have been replaced by the error above.

Hi @bert1! I moved your comment to a separate topic, as it looks like your problem is different from this other one.

To help us better understand your problem, please paste here the output of the following commands:

docker ps | grep mysql
tutor local logs --tail=100 mysql

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.