mysql5.7导入数据的权限问题
生活随笔
收集整理的這篇文章主要介紹了
mysql5.7导入数据的权限问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
mysql5.7中創建用戶時雖然使用 grant all on xxx.* to test@"localhost" 但是使用mysql命令導入時,還是會出錯 mysql --default-character-set=utf8 -utest -p testdb < testdb20180103.sql 會出現下面錯誤:
mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
解決辦法是: 用root登錄mysql 查詢super權限
select user,Super_priv from mysql.user;
賦予super權限
update mysql.user set Super_priv='Y' where user='test';刷新權限
flush privileges;
這時就可以導入sql文件了
導入完成后收回super權限
update mysql.user set Super_priv='N' where user='test'; flush privileges;
總結
以上是生活随笔為你收集整理的mysql5.7导入数据的权限问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ArcEngine中IFeatureCl
- 下一篇: ORACLE常用性能监控SQL【一】