MySQL5.6添加root用户报错:Field 'ssl cipher' doesn't have a default value

解决方法:
GRANT USAGE ON *.* TO 'root'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;
GRANT USAGE ON *.* TO 'root'@'l127.0.0.1' IDENTIFIED BY '123456' WITH GRANT OPTION;

记得要刷新一下:flush privileges;
重新登录mysql -uroot -p123456
查看当前登录用户和登录的方式:
mysql> select user();
+----------------+
 | user()           |
+----------------+
 | root@localhost |
+----------------+
1 row in set (0.00 sec)
这样就可以不走@'%'
还可以修改root @'%'方式的权限:

mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456" WITH GRANT OPTION;
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
你权限的时候会显示:Grant_priv: Y
这样root用户以@'%'方式就可以做grant操作

你可能感兴趣的:(mysql5.6)