Why does the database configuration have to be filled with IP in the wordpress project built by linux?

I built a linux virtual machine locally, and then deployed the wordpress project. Why? when I visited the project locally, I prompted that the database link failed, and then I changed the localhost of the DB_HOST configured in the database to the IP of linux. Why is this

?
May.10,2021

check whether the / etc/hosts file is configured
127.0.0.1 localhost

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b80b-2b7e6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b80b-2b7e6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?