Access to mysql with nodej and child_process

Hello,

When I can access on the code to mysql ? with child_process :
I do like :

const importTo = {
            host: 'mysql',
            user: env.db.username,
            password: env.db.password,
            database: env.db.database,
        };

const dumpFile = '"' + path.join(__dirname, '../../../BDD/referentiel/init.sql') + '"';

exec(`mysql -u ${importTo.user} -p ${importTo.password} -h ${importTo.host} ${importTo.database} < ${dumpFile}`, (err, stdout, stderr) => {
       if (err) { console.error(`exec error: ${err}`); return undefined; }
});

But it tell that mysql is not found …

Thanks

What are your MySQL settings:
host
username
password
database

Probably you have not set the host correctly