in reply to MySQL syntax error GRANT

See DBI placeholders

With most drivers, placeholders can't be used for any element of a statement that would prevent the database server from validating the statement and creating a query execution plan for it.

i.e database names, table names, column names etc. Try

$sql = "GRANT ALL ON $db.* TO ?@? IDENTIFIED BY ?"; $dbh->do($sql, {}, $user, $host, $password);
poj

Replies are listed 'Best First'.
Re^2: MySQL syntax error GRANT
by Anonymous Monk on Oct 02, 2018 at 19:50 UTC

    Very interested indeed. It works, provided IDENTIFIED BY ? is not passed, as it really seems it is no (more?) accepted in 8.0