@monstajamss You need to setup a persistent volume. Checkout
https://tecadmin.net/docker-compose-persistent-mysql-data/
or
https://stackoverflow.com/questions/48182698/mounting-volumes-with-docker-compose
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to run laravel on docker but i use the command docker-compose down my laravel database reset when i bring it back up using docker-compose up -d.
And when i try to run php artisan migratei get this error
SQLSTATE[HY000] [2002] php_network_getaddresses: gethostbyname failed. errno=0 (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations and table_type = 'BASE TABLE')
How can i avoid this?
@monstajamss You need to setup a persistent volume. Checkout
https://tecadmin.net/docker-compose-persistent-mysql-data/
or
https://stackoverflow.com/questions/48182698/mounting-volumes-with-docker-compose
Please or to participate in this conversation.