linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
762 stars 108 forks source link

Unable to connect to DB mariadb #95

Closed corasaniti closed 3 years ago

corasaniti commented 3 years ago

unable to connect to DB mariadb

`` docker exec -it bookstack php /var/www/html/artisan bookstack:update-url https://example.com http://myip:6875


Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = bookstackapp and table_name = migrations and table_type = 'BASE TABLE') at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669 665| // If an exception occurs when attempting to run a query, we'll format the error 666| // message to include the bindings with SQL, which will make this exception a 667| // lot more helpful to the developer instead of just the database's errors. 668| catch (Exception $e) {

669| throw new QueryException( 670| $query, $this->prepareBindings($bindings), $e 671| ); 672| } 673|

Exception trace: 1 Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[HY000] [2002] No such file or directory") /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18 2 Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException)) /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43ù Please use the argument -v to see more details.

please ask for help thank you

github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

Bogey commented 3 years ago

What does the invalid label mean? I have the same issue, except for one [2002] No such file or directory" I have [1045] Access denied for user 'bookstack'@'172.17.0.8' (using password: YES)") The thing is that any other app, tool, person can access the db except for bookstack.

Roxedus commented 3 years ago

There is missing info, the issue template did not get filled.

Bogey commented 3 years ago

I followed the guide and it failed. Nothing more to add. Then I used soldidnerd's image and it worked. Seems that your documentation has an error. The same error was already mentioned in the forum:

DB_PASS appears to be being ignored. I was having the same issue with the connection attempting to connect to the Mysql DB and not providing a password. Changing the env var to DB_PASSWORD corrected the issue and the instance now connects to the database correctly.

So I moved back to the linuxserver image, used DB_PASSWORD instead of DB_PASS and tada, done.

tobbenb commented 3 years ago

The variable is only set in the env file on first run, so if there was something wrong with the setup and the variable was set to something else, it would not take effect. After first run you have to change the env file (or setting file. I don't remember how it's done in bookstack). So there is nothing wrong with our env variables.

homerr commented 3 years ago

As stated above it is working as intended, and the documentation is correct. Issues with the escaping of special characters was corrected in #100 in case this was related to your problems.