Slow mysql connection only by browser

Hi, I have docker toolbox for windows home and I have a file that queries the database, but the speed detected by chrome to see the results is slow. If I run a query from the php storm terminal it is immediate. I would like to know if there was a solution to this slowdown. The file I am running to test is just an empty file with only the code for the query. This is a problem when i reload the page of my site.
Thank you