You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing this just in case someone encounters the same error. For context, Laravel has this artisan command called php artisan db. I myself often use that to check database connectivity. But when I tried running it on spin like so spin exec php php artisan db, I encountered this error:
So what I did was I ranted immediately on the Discord group. Just kidding! 😂 Well, I did it once and yeah, that's wrong. Do not do that! These awesome people don't deserve it!
So back to the topic, I shared it to the group and had some discussions and learned that it's not possible since as stated on the error, there is no mysql cli installed anywhere in the php container.
So a lesson was learned. Moving forward, if you want to check for database connectivity, just run php artisan migrate instead of php artisan db. If there is a need to connect to the database, just connect directly to the mysql container instead which is as easy as php exec mysql mysql -u <username> -p.
So yeah, I hope you have resolved your issue. Have a nice day, beautiful person! 😘 Stay awesome! 😉
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I am writing this just in case someone encounters the same error. For context, Laravel has this artisan command called
php artisan db
. I myself often use that to check database connectivity. But when I tried running it on spin like sospin exec php php artisan db
, I encountered this error:So what I did was I ranted immediately on the Discord group. Just kidding! 😂 Well, I did it once and yeah, that's wrong. Do not do that! These awesome people don't deserve it!
So back to the topic, I shared it to the group and had some discussions and learned that it's not possible since as stated on the error, there is no
mysql cli
installed anywhere in thephp
container.So a lesson was learned. Moving forward, if you want to check for database connectivity, just run
php artisan migrate
instead ofphp artisan db
. If there is a need to connect to the database, just connect directly to themysql
container instead which is as easy asphp exec mysql mysql -u <username> -p
.So yeah, I hope you have resolved your issue. Have a nice day, beautiful person! 😘 Stay awesome! 😉
Beta Was this translation helpful? Give feedback.
All reactions