ubuntu下mysql添加用户的问题


 在ubuntu下使用命令:

 $:sudo apt-get install mysql-server 命令安装的Mysql

版本为:Server version: 5.7.13-0ubuntu0.16.04.2 (Ubuntu)

进入mysql添加用户使用命令:

mysql> insert into mysql.user(Host,User) values("localhost","hive");

提示出错:
ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value

原因是这个Mysql版本里User表里没有Password字段了。

解决方案:

mysql> grant all on *.* to yushan@"%" identified by "123" ;
mysql>flush privileges; (刷新系统权限表)
(执行完会在mysql.user表插入一条记录,all表示所有权限(包括增 删 改 查等权限),
*.* 表示所有数据库,yushan为添加的用户名,123为密码,%为匹配的所有主机,
上面的信息都可以指定如grant select,update on db.* to yushan@localhost identified by '123";)

----------------


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM