haiwen / seafile-docker

A Docker image for Seafile server
Other
544 stars 183 forks source link

Not ollowed to connect to database #234

Closed pide2000 closed 1 year ago

pide2000 commented 3 years ago

I've started seafile docker using docker-compose

log says: waiting for mysql server to be ready: %s (1130, "Host '172.20.0.4' is not allowed to connect to this MariaDB server")

My docker-compose file looks like this: `version: '2.0' services: db: image: mariadb:10.1 container_name: seafile-mysql environment:

networks: seafile-net:`

biozz commented 3 years ago

I had similar issue and didn't quite understand what happened, but managed to find a workaround. Not sure if this is going to work for you though.

I removed seafile user with DROP USER 'seafile'@'%.%.%.%', made sure that there were no other user named seafile in db and started again. And it was successful.

My guess is that you might have accidentally changed the password or maybe db data folder was not clean.

As a side note: you can format blocks of code with triple backticks, instead of one.

funkyfuture commented 3 years ago

yes, the bootstrapping or whatever is fucking up the database's grant tables. what it did to solve this was adding a file /docker-entrypoint-initdb.d/seafile.sql to the db container:

GRANT ALL ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;

mind that this is only applied when no database exists yet.