Hi.
I’m trying to deploy seafile with docker. Seafile does not start properly. In the logs I found this:
Failed to connect to mysql server using user "seafile" and password "***": Access denied for user 'seafile'@'172.19.0.2' (using password: YES)
How can I fix this issue?
Try to be sure of your password and if possible for the password avoid special characters
Thanks for your advice.
I already checked the password in the users table of mariadb.
That looks like it didn’t create the seafile user correctly in the database. Are you using your own existing database server, or the docker one that the guide tells you to deploy?
Assuming you are using the docker DB, the normal process is that it starts that docker with the root password set to what you set INIT_SEAFILE_MYSQL_ROOT_PASSWORD to in the .env file. Then the seafile container connects to is as root using that same password, and creates the seafile user.
It’s strange that it seems to have got past the part where it connects as root, but can’t login as that seafile user.
So, I would try manually connecting as root and see if you can fix that user. It should be something like:
mysql -u root -h 172.19.0.2 -P 3306 -p seafile_db
It will ask for a password. This should be whatever you set in “NIT_SEAFILE_MYSQL_ROOT_PASSWORD”.
Then fix (or create) the seafile user (replace pass with what you set SEAFILE_MYSQL_DB_PASSWORD to, and seafile with whatever you set SEAFILE_MYSQL_DB_USER to):
GRANT ALL PRIVILEGES ON *.* TO 'seafile'@'%' IDENTIFIED BY 'pass' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `ccnet_db`.* to 'seafile'@'%';
GRANT ALL PRIVILEGES ON `seafile_db`.* to 'seafile'@'%';
GRANT ALL PRIVILEGES ON `seahub_db`.* to 'seafile'@'%';
Then try restarting and see if it is fixed.
And if none of that works, maybe try clearing everything and start again.
Hi.
Thank you very much for your tip.
Unfortunately, it didn’t work. But it brought me to the right thought:
I typed rm -R /opt/seafile-mysql
and removed the containers (seafile and mysql) and created them again.
It works fine now.
Thank you again 