Windows版の MySQL で、GRANT で新ユーザを作成しようとしたら、
mysql> grant all on inquiry.* to 'ODBC'@'localhost'; ERROR 1133 (42000): Can't find any matching row in the user table
と言われた。 Windows版では、my.ini の sql_mode に NO_AUTO_CREATE_USER が指定されていて、パスワード無しのユーザを作成できない。そんな時は、NO_AUTO_CREATE_USER をはずすか、パスワード付きでユーザを作ればいい。
- NO_AUTO_CREATE_USER をはずす
-
mysql> set sql_mode=""; Query OK, 0 rows affected (0.00 sec) mysql> grant all on inquiry.* to 'ODBC'@'localhost'; Query OK, 0 rows affected (0.00 sec)
- パスワード付きでユーザを作成する
-
mysql> grant all on inquiry.* to 'test2'@'localhost'; ERROR 1133 (42000): Can't find any matching row in the user table mysql> grant all on inquiry.* to 'test2'@'localhost' identified by 'test2'; Query OK, 0 rows affected (0.00 sec)
