I've a little problem: I have a script that writes the privileges of new MySQL users into the mysql.db table. Now it seems as if this table has changed from MySQL 3.23 to MySQL 4.0, i.e., there are now more privileges columns than before.
Now for MySQL 3.23 I'm running this command:
INSERT INTO `db` (`Host`, `Db`, `User`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`) VALUES ('localhost', 'database_name', 'database_user', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
but for MySQL 4.0 I'd have to change it. But it's bothersome to program a routine that finds out which MySQL version is used or which privileges columns are available for the database in question in order to form the right SQL INSERT statement.
So my question is: is there an easier way to do this?