数据库迁移仅适用于 127.0.0.1 但从网站访问是带有宅基地的本地主机

Database migrating only working with 127.0.0.1 but access from website is localhost with homestead

我在 Users/[用户名]/Homestead 中设置了一个 Homestead,并在 运行 几个网站上设置了一个 vagrant,这工作正常。

ip: 192.168.10.10
memory: 2048
cpus: 2
provider: virtualbox
mariadb: true

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    -
        map: '~/Sites/domain1'
        to: /home/vagrant/domain1
    -
        map: '~/Sites/domain2'
        to: /home/vagrant/domain2

sites:
    -
        map: domain1.app
        to: /home/vagrant/domain1/public
    -
        map: domain2.app
        to: /home/vagrant/domain2/public

databases:
    - homestead
    - domain1database
    - domain2database

我正在 运行从 Users/[username] 中 vagrant upvagrant ssh ]/Homestead 目录.

问题与迁移有关,然后从前端访问数据库,例如 https://domain1.app and https://domain2.app

例如,具有以下设置的 .env 允许从 /User/[username]/Sites/domain1.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33060
DB_DATABASE=domain1database
DB_USERNAME=homestead
DB_PASSWORD=secret

但我只能通过以下方式访问这些数据库前端。

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=33060
DB_DATABASE=domain1database
DB_USERNAME=homestead
DB_PASSWORD=secret

所以目前我必须不断更改127.0.0.1localhost

网站是否需要驻留在 Homestead 文件夹中?

UPDATE/SOLUTION:

我已经设法解决了 .env.

中这些设置的问题
DB_CONNECTION=mysql
DB_HOST=192.168.10.10
DB_PORT=3306
DB_DATABASE=domain1database
DB_USERNAME=homestead
DB_PASSWORD=secret

上述设置同样适用于 Sequel Pro.