GRANT on skip-grant-tables causes “cannot execute this statement” error
"GRANT ALL PRIVILEGES" SQL is very convenient to create an user, but it cannot use on --skip-grant-tables environment through it is often used together.
Altenatively I can use INSERT INTO mysql.user syntax, but it is very complex.
<strong>How to repeat:</strong>
1) Launch mysqld with --skip-grant-tables.
2) Execute SQL like:
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'password';
This causes error:
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
<strong>you have to run 'flush privileges' before grant will work when running with skip-grant-tables</strong>