Vagrant & Puppet - 使用 puphpet 将 sql 导入 mysql 数据库时出错

Vagrant & Puppet - error when using puphpet to import sql into mysql database

==> payments: Notice: /Stage[main]/Puphpet::Mysql::Install/Puphpet::Mysql::Databases[from puphpet::mysql::install]/Exec[users-import]/returns: sh: 1: cannot open db/dump.sql: No such file
==> payments: Error: mysql users < db/dump.sql && touch /opt/puphpet-state/db-import-users returned 2 instead of one of [0]
==> payments: Error: /Stage[main]/Puphpet::Mysql::Install/Puphpet::Mysql::Databases[from puphpet::mysql::install]/Exec[users-import]/returns: change from notrun to 0 failed: mysql users < db/dump.sql && touch /opt/puphpet-state/db-import-users returned 2 instead of one of [0]

vagrant up 我收到上述错误。

sql 导入文件位于 db 目录中(见屏幕截图)。我在想,也许 SQL 文件没有及时复制到虚拟机?值得注意的是,我在puphpet文件中创建了三个数据库,然后在创建最后一个时导入sql。 sql 文件创建表并插入一些数据。

MySQL 数据库的 Puppet 配置

databases:
    mysqlnd_b349iw3pewx1:
        name: sites
        sql: ''
    mysqlnd_b349iw3pewx2:
        name: ia
        sql: ''
    mysqlnd_b349iw3pewx3:
        name: users
        sql: '../db/dump.sql'

目录结构

我正在通过 puphpet 使用 puppet。

如果您不确定路径,正如我在评论中提到的,只需指出文件的完整路径

databases:
    mysqlnd_b349iw3pewx1:
        name: sites
        sql: ''
    mysqlnd_b349iw3pewx2:
        name: ia
        sql: ''
    mysqlnd_b349iw3pewx3:
        name: users
        sql: '/home/vagrant/db/dump.sql'