Skip to content
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

Laravel with laradock and mariadb migrations failed #3191

Closed
swim89 opened this issue Apr 9, 2022 · 2 comments
Closed

Laravel with laradock and mariadb migrations failed #3191

swim89 opened this issue Apr 9, 2022 · 2 comments

Comments

@swim89
Copy link

swim89 commented Apr 9, 2022

Info:

Docker version ($ docker --version): Docker version 20.10.13, build a224086
Laradock commit ($ git rev-parse HEAD): fee2d33
System info (Mac, PC, Linux): Mac
System info disto/version: MacOs Monterey 12.3 (21E230)
Chip: Apple M1

Issue:

I am getting the following error

    [2022-04-07 12:11:23] local.ERROR: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = swimrace and table_name = migrations and table_type = 'BASE TABLE') {"exception":"[object] (Illuminate\\Database\\QueryException(code: 2002): SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = swimrace and table_name = migrations and table_type = 'BASE TABLE') at /var/www/swimrace/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712)

When I run php artisan migrate

I'm running it inside the container using this command docker-compose exec workspace bash

settings on .env (laradock):

### MARIADB ###############################################
    
    MARIADB_VERSION=latest
    MARIADB_DATABASE=default
    MARIADB_USER=root
    MARIADB_PASSWORD=root
    MARIADB_PORT=3306
    MARIADB_ROOT_PASSWORD=root
    MARIADB_ENTRYPOINT_INITDB=./mariadb/docker-entrypoint-initdb.d

settings on .env (project):

DB_CONNECTION=mysql
    DB_HOST=mariadb
    DB_PORT=3306
    DB_DATABASE=swimrace
    DB_USERNAME=swimrace_user
    DB_PASSWORD=raceswim

User and password in this last configuration was created via console into mariadb container and assigned to this account all privileges.

If I try to read/write into database with any database ui tools (PMA, DataGrip, etc) I can see and write inside the database, but not with artisan commands.

@stale
Copy link

stale bot commented Jul 10, 2022

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Jul 10, 2022
@stale
Copy link

stale bot commented Jul 31, 2022

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant