In the production environment, the database connection is very fast, as expected. However, when using the same configuration on localhost, it takes around 10 seconds to connect. I've tried several solutions, but none have worked so far. I tested connecting to a different server, and the connection is established quickly. But when connecting from localhost, it still takes time. The MySQL port is open, and I've restarted the server, but the issue persists.