Manuel Install version v0.28.2 - Error php artisan migrate #1587

Closed
opened 2026-02-05 01:19:58 +03:00 by OVERLORD · 14 comments
Owner

Originally created by @sebastienhouzet on GitHub (Mar 13, 2020).

Describe the bug
Impossible to create database during Manuel Install

Steps To Reproduce
Follow doc for manuel install : https://www.bookstackapp.com/docs/admin/installation/#manual
During cmd : php artisan migrate

Expected behavior

$ php artisan migrate
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > y


   Illuminate\Database\QueryException  : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = books and table_name = migrations and table_type = 'BASE TABLE')

  at /Users/xx/temp/bookstack/shared/BookStack/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\PDOException::("SQLSTATE[HY000] [2002] No such file or directory")
      /Users/xx/temp/bookstack/shared/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

  2   PDOException::("SQLSTATE[HY000] [2002] No such file or directory")
      /Users/xx/temp/bookstack/shared/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

  Please use the argument -v to see more details.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings):
  • PHP Version: PHP 7.3.11 (cli) (built: Dec 13 2019 19:21:21) ( NTS )
  • Hosting Method (Nginx/Apache/Docker): Apache

Additional context
On Mac OS X Catalina

Originally created by @sebastienhouzet on GitHub (Mar 13, 2020). **Describe the bug** Impossible to create database during Manuel Install **Steps To Reproduce** Follow doc for manuel install : https://www.bookstackapp.com/docs/admin/installation/#manual During cmd : php artisan migrate **Expected behavior** ``` $ php artisan migrate ************************************** * Application In Production! * ************************************** Do you really wish to run this command? (yes/no) [no]: > y Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = books and table_name = migrations and table_type = 'BASE TABLE') at /Users/xx/temp/bookstack/shared/BookStack/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\PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /Users/xx/temp/bookstack/shared/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31 2 PDOException::("SQLSTATE[HY000] [2002] No such file or directory") /Users/xx/temp/bookstack/shared/BookStack/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27 Please use the argument -v to see more details. ``` **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): - PHP Version: PHP 7.3.11 (cli) (built: Dec 13 2019 19:21:21) ( NTS ) - Hosting Method (Nginx/Apache/Docker): Apache **Additional context** On Mac OS X Catalina
Author
Owner

@ssddanbrown commented on GitHub (Mar 13, 2020):

Hi @sebastienhouzet,
Have you created a books database within MySQL/MariaDB before running the migrate command?

@ssddanbrown commented on GitHub (Mar 13, 2020): Hi @sebastienhouzet, Have you created a `books` database within MySQL/MariaDB before running the `migrate` command?
Author
Owner

@sebastienhouzet commented on GitHub (Mar 13, 2020):

Yes of course, and i have tried to connect to mysql with credentials.

@sebastienhouzet commented on GitHub (Mar 13, 2020): Yes of course, and i have tried to connect to mysql with credentials.
Author
Owner

@ssddanbrown commented on GitHub (Mar 13, 2020):

@sebastienhouzet Okay, Thanks for confirming. Could you try setting the DB_HOST value to 127.0.0.1 instead of the default localhost? See if that helps at all.

@ssddanbrown commented on GitHub (Mar 13, 2020): @sebastienhouzet Okay, Thanks for confirming. Could you try setting the `DB_HOST` value to `127.0.0.1` instead of the default `localhost`? See if that helps at all.
Author
Owner

@sebastienhouzet commented on GitHub (Mar 13, 2020):

not working.

Possible problem is ' missing on SQL ?
SQL: select * from information_schema.tables where table_schema = books and table_name = migrations and table_type = 'BASE TABLE'

for 'books' and 'migrations' ?

@sebastienhouzet commented on GitHub (Mar 13, 2020): not working. Possible problem is ' missing on SQL ? SQL: select * from information_schema.tables where table_schema = books and table_name = migrations and table_type = 'BASE TABLE' for 'books' and 'migrations' ?
Author
Owner

@ssddanbrown commented on GitHub (Mar 14, 2020):

@sebastienhouzet I think that would cause a different error message if that was to be the issue.

The "Best Answer" here may help, Looks like a common thing on mac setups that the MySQL socket is not configured to the correct place in the PHP install:
https://laracasts.com/discuss/channels/eloquent/sqlstatehy000-2002-no-such-file-or-directory

@ssddanbrown commented on GitHub (Mar 14, 2020): @sebastienhouzet I think that would cause a different error message if that was to be the issue. The "Best Answer" here may help, Looks like a common thing on mac setups that the MySQL socket is not configured to the correct place in the PHP install: https://laracasts.com/discuss/channels/eloquent/sqlstatehy000-2002-no-such-file-or-directory
Author
Owner

@alpha1892 commented on GitHub (Mar 20, 2020):

Does it work?

@alpha1892 commented on GitHub (Mar 20, 2020): Does it work?
Author
Owner

@sebastienhouzet commented on GitHub (Mar 20, 2020):

Hello,

No it doesnt work :/

@sebastienhouzet commented on GitHub (Mar 20, 2020): Hello, No it doesnt work :/
Author
Owner

@alpha1892 commented on GitHub (Mar 21, 2020):

Hi,
Mine work with after so much of tried with the below configuration.

.env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=blog
DB_USERNAME=root
DB_PASSWORD=admin@123

config/database.php
mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => '127.0.0.1',
'port' => 3306,
'database' => 'blog',
'username' => 'root',
'password' => 'admin@123',
'unix_socket' => '',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],

Note: mysql version 8.0.19 with php version 7.3.11 and laravel version 7.1.3

Mysql installation setup path /usr/local/mysql-8.0.19-macos10.15-x86_64/bin/mysql

Hope this is would work for you.

Thanks

@alpha1892 commented on GitHub (Mar 21, 2020): Hi, Mine work with after so much of tried with the below configuration. **.env** file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=blog DB_USERNAME=root DB_PASSWORD=admin@123 **config/database.php** mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), 'host' => '127.0.0.1', 'port' => 3306, 'database' => 'blog', 'username' => 'root', 'password' => 'admin@123', 'unix_socket' => '', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], Note: mysql version 8.0.19 with php version 7.3.11 and laravel version 7.1.3 Mysql installation setup path /usr/local/mysql-8.0.19-macos10.15-x86_64/bin/mysql Hope this is would work for you. Thanks
Author
Owner

@ssddanbrown commented on GitHub (Mar 22, 2020):

@sebastienhouzet Are you also using MySQL8 by any chance?

@ssddanbrown commented on GitHub (Mar 22, 2020): @sebastienhouzet Are you also using MySQL8 by any chance?
Author
Owner

@sebastienhouzet commented on GitHub (Mar 23, 2020):

No i am using MySQL 5.6

@sebastienhouzet commented on GitHub (Mar 23, 2020): No i am using MySQL 5.6
Author
Owner

@ssddanbrown commented on GitHub (Jul 12, 2020):

Hi @sebastienhouzet,
Sorry this dropped off. Are you still having issues you need resolving?
If so, could you confirm if you're using the native PHP/Apache/MySQL components in MacOS or some other installed versions?

@ssddanbrown commented on GitHub (Jul 12, 2020): Hi @sebastienhouzet, Sorry this dropped off. Are you still having issues you need resolving? If so, could you confirm if you're using the native PHP/Apache/MySQL components in MacOS or some other installed versions?
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2021):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Jan 26, 2021): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Author
Owner

@Niraj-kumar99 commented on GitHub (Nov 24, 2021):

thank u @alpha1892 finally migration worked for me

@Niraj-kumar99 commented on GitHub (Nov 24, 2021): thank u @alpha1892 finally migration worked for me
Author
Owner

@robigan commented on GitHub (Apr 29, 2022):

I found this issue, and I crave violence, after having switched the db host on a podman container installation from localhost to 127.0.0.1

@robigan commented on GitHub (Apr 29, 2022): I found this issue, and I crave violence, after having switched the db host on a podman container installation from localhost to 127.0.0.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1587