Unifiedtransform icon indicating copy to clipboard operation
Unifiedtransform copied to clipboard

SQLSTATE[HY000] [2002] Host is unreachable (SQL: SHOW FULL TABLES WHERE table_type = 'BASE TABLE')

Open sjsajju opened this issue 4 years ago • 11 comments

Trying to run the project with the docker. Followed the steps and copied values into .env file. after that ran the sudo ./docker-install.sh command. At the very end of the setup process i get the above mentioned error. Now I don't understand where the issue lies. Would request someone to please have a look and help me out why such an issue is occurring. It seems like the DB is not rightly set up but why I don't understand. Here is the screenshot of what I see when logged in: Screenshot 2021-06-14 at 5 41 15 PM

And here is what I am seeing on my terminal: Screenshot 2021-06-14 at 5 42 04 PM

Any help would be highly appreciated.

sjsajju avatar Jun 14 '21 12:06 sjsajju

I'm the pull requester of the new Docker setup Kindly share your .env so I could give insight on this

handhikadj avatar Jun 20 '21 17:06 handhikadj

Facing the same issue and using the default env file:

APP_NAME=UnifiedTransform
APP_ENV=local
APP_KEY=base64:JZLAgKJlzf/7V/2FlwvmNfh6xAp9bvtq7vZpMwIjhmk=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=school
DB_USERNAME=root
DB_PASSWORD=schoolapp

DOCKER_WEBSERVER_HOST=4049
DOCKER_PHPMYADMIN_HOST=5051

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

STRIPE_KEY=
STRIPE_SECRET=

kanishk09 avatar Jul 02 '21 16:07 kanishk09

make your .env file like this in like 8:

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=unifiedtransform DB_USERNAME=root DB_PASSWORD=

enjoy!

vyrral avatar Jul 04 '21 19:07 vyrral

also make sure you dont edit:

"APP_NAME=UnifiedTransform"

vyrral avatar Jul 14 '21 11:07 vyrral

@sjsajju Are you able to access the Docker mysql through the Docker phpmyadmin?

handhikadj avatar Jul 14 '21 11:07 handhikadj

@sjsajju Not sure if you resolved this. the problem is my sql thinks you are trying to add a user instead of setting the root user password. current docker-composer.yml file MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} MYSQL_USER: ${DB_USERNAME} MYSQL_PASSWORD: ${DB_PASSWORD} you can fix this by changing the .env file

DB_CONNECTION=mysql DB_HOST=db DB_PORT=3306 DB_DATABASE=school DB_USERNAME=Something else than root DB_PASSWORD=schoolapp

also note the root password will be same as alternative user password for db.

dinesh46 avatar Jul 23 '21 02:07 dinesh46

a bugfix has been merged to master on #312 kindly re-pull and confirm if this issue still persists Tested on Ubuntu 20.04 (VPS Server), Docker version 20.10.7 and docker-compose version 1.27.4

handhikadj avatar Jul 26 '21 06:07 handhikadj

Docker setup seems to be broken right now. But manual installation instruction works properly.

changeweb avatar Jul 28 '21 18:07 changeweb

@changeweb please give more detail about it

handhikadj avatar Jul 29 '21 04:07 handhikadj

@sjsajju I have found the fix. Replace DB_HOST=db with DB_HOST=localhost in .env file.

changeweb avatar Aug 13 '21 19:08 changeweb

@changeweb then it will use mysql in your host machine instead of the mysql in docker

handhikadj avatar Aug 14 '21 06:08 handhikadj