BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.4k stars 1.93k forks source link

Error in the installation phase - BookStack haven't access to the database #5155

Closed nicfab closed 3 months ago

nicfab commented 3 months ago

Attempted Debugging

Searched GitHub Issues

Describe the Scenario

I followed the instructions to install (manually) Bookstack here https://www.bookstackapp.com/docs/admin/installation/#manual. After running php artisan migrate, I receive the error as the following image.

sshot_2024-08-07_20 20 19

I underline that I already have a BookStack instance working fine that I have to migrate to another server.

Exact BookStack Version

latest

Log Content

Next Illuminate\\View\\ViewException: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `users` where `system_name` = public limit 1) (View: /var/www/bookstack/resources/views/layouts/base.blade.php) (View: /var/www/bookstack/resources/views/layouts/base.blade.php) in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
Stack trace:
#0 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(60): Illuminate\\View\\Engines\\CompilerEngine->handleViewException()
#1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(195): Illuminate\\View\\Engines\\CompilerEngine->get()
#3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\\View\\View->getContents()
#4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\\View\\View->renderContents()
#5 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\\View\\View->render()
#6 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent()
#7 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Illuminate\\Http\\Response->__construct()
#8 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(87): Illuminate\\Routing\\ResponseFactory->make()
#9 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(626): Illuminate\\Routing\\ResponseFactory->view()
#10 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(554): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException()
#11 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(460): Illuminate\\Foundation\\Exceptions\\Handler->prepareResponse()
#12 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(377): Illuminate\\Foundation\\Exceptions\\Handler->renderExceptionResponse()
#13 /var/www/bookstack/app/Exceptions/Handler.php(89): Illuminate\\Foundation\\Exceptions\\Handler->render()
#14 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(233): BookStack\\Exceptions\\Handler->render()
#15 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(210): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->renderHttpResponse()
#16 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(270): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleException()
#17 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#18 {main}
  thrown at /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)
[stacktrace]
#0 {main}
"}

Hosting Environment

PHP 8.1 - Ubuntu 22.04.4 LTS

ssddanbrown commented 3 months ago

Hi @nicfab, Can you share the commands you ran to create the database and user for BookStack in MySQL?

nicfab commented 3 months ago

Hi @nicfab, Can you share the commands you ran to create the database and user for BookStack in MySQL?

I solved. I made an error during the installation process. Thank you very much for your support.