Mysql’de ERROR 1396 (HY000): Operation CREATE USER failed for ‘username’@’localhost’ şeklinde bir hata ile karşılaştığınızda yapmanız gereken örnek bir senaryo ile aşağıdaki gibi ifade etmeye çalıştım.
Örnek Senaryo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
mysql> CREATE USER 'omer'@'localhost' IDENTIFIED BY 'test123'; Query OK, 0 rows affected (0.00 sec) mysql> select user,host from user; +------------------+-----------------+ | user | host | +------------------+-----------------+ | root | 127.0.0.1 | | debian-sys-maint | localhost | | omer | localhost | | root | localhost | +------------------+-----------------+ 4 rows in set (0.00 sec) mysql> delete from user where user = 'omer'; Query OK, 1 row affected (0.00 sec) mysql> select user,host from user; +------------------+-----------------+ | user | host | +------------------+-----------------+ | root | 127.0.0.1 | | debian-sys-maint | localhost | | root | localhost | +------------------+-----------------+ 3 rows in set (0.00 sec) mysql> CREATE USER 'omer'@'localhost' IDENTIFIED BY 'test123'; ERROR 1396 (HY000): Operation CREATE USER failed for 'omer'@'localhost' mysql> CREATE USER 'omeroner'@'localhost' IDENTIFIED BY 'test123'; Query OK, 0 rows affected (0.00 sec) mysql> select user,host from user; +------------------+-----------------+ | user | host | +------------------+-----------------+ | root | 127.0.0.1 | | debian-sys-maint | localhost | | omeroner | localhost | | root | localhost | +------------------+-----------------+ 4 rows in set (0.00 sec) |
Mysql’de yukarıda belirttiğim gibi bir senorya yaşadığınızı farzedelim. ilk yapmanız gereken;
1.Yöntem:
1 |
mysql >flush privileges; |
bu işlemde hatayı çözmenize yardımcı olmuyor ise mysql’de var ola bir bug ve çözümü şu şekilde;
2.Yöntem:
1 2 3 |
mysql >drop user omer@localhost; mysql >flush privileges; mysql >create user omer@localhost identified by 'admins_password' |
So, what do you think ?