ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: Host '172.18.0.6' is not allowed to connect to this MySQL server

Open Travel-dust opened this issue 10 months ago • 8 comments

Describe your problem

ragflow-server | peewee.OperationalError: (1130, "Host '172.18.0.6' is not allowed to connect to this MySQL server")

Travel-dust avatar Feb 08 '25 00:02 Travel-dust

The passowrd of Mysql in conf/service_conf.yaml is probably not a right one.

KevinHuSh avatar Feb 08 '25 02:02 KevinHuSh

same issue, untouched password as infini_rag_flow

why-in-Shanghaitech avatar Feb 08 '25 03:02 why-in-Shanghaitech

The passowrd of Mysql in conf/service_conf.yaml is probably not a right one. conf/service_conf.yaml: ragflow: host: 0.0.0.0 http_port: 9380 mysql: name: 'rag_flow' user: 'root' password: 'infini_rag_flow' host: 'mysql' port: 5455 max_connections: 100 stale_timeout: 30 minio: user: 'rag_flow' password: 'infini_rag_flow' host: 'minio:9000' es: hosts: 'http://es01:1200' username: 'elastic' password: 'infini_rag_flow' infinity: uri: 'infinity:23817' db_name: 'default_db' redis: db: 1 password: 'infini_rag_flow' host: 'redis:6379'

I don't see a problem.

Travel-dust avatar Feb 08 '25 11:02 Travel-dust

same issue, untouched password as infini_rag_flow

Where to modify the password,?I saw that the passwords in 'conf/service_conf.yaml' and 'ragflow-main\docker.env' files are consistent, both of them are ‘infini_rag_flow’.

Travel-dust avatar Feb 08 '25 12:02 Travel-dust

It seems that this is no about password but something else:

$ sudo docker exec -it ragflow-mysql /bin/bash
bash-5.1# echo $MYSQL_ROOT_PASSWORD
infini_rag_flow
bash-5.1# mysql -uroot -pinfini_rag_flow
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '172.21.0.3' is not allowed to connect to this MySQL server

I am not familiar about MySQL. Anyone can help?

why-in-Shanghaitech avatar Feb 17 '25 13:02 why-in-Shanghaitech

Your mysql docker is not started, try to delete all mysql data on volumes and restart mysql.

pan003 avatar Feb 17 '25 17:02 pan003

mysql docker is not started, try to delete all mysql data on volumes and restart mysql.

Thank you! This solves my problem.

The problem lies in a failure at the first time I start the docker, while stop it before it finishes start up. It hints that MySQL is unhealthy then exit, but actually it take over 2 mins to start.

https://github.com/infiniflow/ragflow/blob/7b5d8312961874841b652512ac5495b2b46a017b/docker/docker-compose-base.yml#L95

Suggested change:

- retries: 3
+ retries: 30

To fix this, the user needs to

  1. Remove ragflow_mysql container and docker_mysql_data volume.
  2. Restart by running docker compose up. If it fails due to unhealthy problem, do not stop it. Run another docker compose up after 5 mins.

why-in-Shanghaitech avatar Feb 18 '25 00:02 why-in-Shanghaitech

It might be that the environment variable is overriding MYSQL_PASSWORD. Change it to the same password and check using docker inspect container_id | grep MYSQL_ROOT_PASSWORD.

obelieve avatar Feb 22 '25 15:02 obelieve

mysql docker is not started, try to delete all mysql data on volumes and restart mysql.

Thank you! This solves my problem.

The problem lies in a failure at the first time I start the docker, while stop it before it finishes start up. It hints that MySQL is unhealthy then exit, but actually it take over 2 mins to start.

ragflow/docker/docker-compose-base.yml

Line 95 in 7b5d831

retries: 3 Suggested change:

  • retries: 3
  • retries: 30 To fix this, the user needs to
  1. Remove ragflow_mysql container and docker_mysql_data volume.
  2. Restart by running docker compose up. If it fails due to unhealthy problem, do not stop it. Run another docker compose up after 5 mins.

Thank you! This solves my problem.

  1. docker volume ls can list all currently existing volumes.
  2. docker volume rm can deletes the specified volume.

Endless4Summer avatar Mar 26 '25 07:03 Endless4Summer