DBD-mysql
DBD-mysql copied to clipboard
GRANT can no longer create users at the same time as granting them permissions
trafficstars
Makefile.PL prompts the user to grant all privileges on test.* to '$user'\@'localhost' identified by 's3kr1t' but this no longer works in MySQL 8. You need to issue two commands, one to create the user and a second to grant:
mysql> grant all privileges on test.* to 'dcantrell'@'localhost' identified by 's3kr1t';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 's3kr1t'' at line 1
mysql> create user 'dcantrell'@'localhost' identified by 's3kr1t';
Query OK, 0 rows affected (0.01 sec)
mysql> grant all privileges on test.* to 'dcantrell'@'localhost';
Query OK, 0 rows affected (0.00 sec)