-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to database at install #1285
Comments
I think I had the same error. Does it make any difference if you try 127.0.0.1 instead of localhost? |
Dude, Hope can get the solution for this case. Thanks |
In my case, I tried both... :( Still getting problem |
I'm getting a different error message: 2019-03-15 13:39:00 [EXCEPTION] [N/A] Unable to connect to DB |
It seems your error message is complaining about your username/password. 2019-03-15 09:23:53 [EXCEPTION] [N/A] (P) SQLSTATE[HY000] [1045] Access denied for user 'usr_db_syspass'@'localhost' (using password: YES) I believe the default is root:syspass |
@cRaZy-bisCuiT Hello, database server should be installed in another container, so the connection user wouldn't be xxx@localhost it should be xxx@ip_address (or hostname) instead Regards |
@lin-unix are you using docker too? |
@nuxsmin, I am using Docker. |
@lin-unix is the database installed in another container? If so, connection user won't be @localhost |
It is, what would the connection user be? I haven't edited the yml file so I have the default setup. |
So I changed the MariaDB port, entered in the Database Server field, entered "syspass-db" into the Database Name field and entered the default password (syspass), which got me a bit closer to solving this. I get this error now, similar to @brunobva 2019-03-15 18:43:03 [EXCEPTION] [N/A] (P) SQLSTATE[HY000] [1045] Access denied for user 'sp_5c8bf2355ff15'@'172.18.0.1' (using password: YES) User is set to root@128.100.167.xx:32768 |
Any ideas to help me out? |
I'm having a similar issue when stopping the container and restarting it. I think the problem is that the install creates a new user with specific privileges in the mariadb and it specifies the source hostname (which for the container is a random string) and IP address, but when creating and deleting the container (es. when running docker-compose down and then docker-compose up) the IP and hostname of the docker container changes and syspass tries to connect to the db with a different user that does not exist in the DB. |
@giordyb how would I edit the config.xml file inside an image? |
I used the docker-compose file that is mentioned in https://doc.syspass.org/en/3.0/installing/docker.html which creates 3 volumes, one of them contains the config.xml. |
@giordyb Hello, that's the standard way but best practices about Docker, is to create a host volume (shared or not) and bind the config directory to it. To other contributors: Please do not edit configuration stuff inside a container, neither store backups in it... Regards |
@nuxsmin what do you mean? I am editing the file inside the dedicated volume (which is bound to the config directory), not inside the container. |
@giordyb sure, it's good way, but you need to deal with a long directory path... Docker volumes are used to keep persistent data across the containers lifecycle, but the best way to modify container's data is binding to a host directory. |
Instead of localhost it should be syspass-db |
Thank you very much!!!!! |
sysPass Version
3.0.5
Describe the question
Now that I have sysPass installed in Docker, I'm having trouble getting it to connect to the database.
Usernames and passwords are all entered into the form. Database server is localhost. Database name is the default 'syspass'. When I click Install, I get this error:
"Unable to connect to DB
Error 2002: SQLSTATE[HY000] [2002] No such file or directory"
Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: