美文网首页
mysql错误码1130 host is not allowed

mysql错误码1130 host is not allowed

作者: 普通的一个程序员 | 来源:发表于2021-01-09 11:46 被阅读0次

错误信息:

image.png

解决办法

登陆MySQL

> use mysql
> update user set host = '%' where user = 'root';
>FLUSH PRIVILEGES;

使用root远程登陆风险较高 建议创建权限较小的用户远程登陆

  1. 心建用户
create user blog_db identified by '密码';
select * from mysql.user where user='blog_db';
  1. grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利,此处只有table这个级别的权限
grant select,insert,update,delete on blog_db.* to blog_db@'%';
  1. grant 操作 MySQL 存储过程、函数 权限。
grant create routine on blog_db.* to blog_db@'%'; # 可以创建proc
grant execute on blog_db.* to blog_db@'%'; #可以执行proc
  1. 创建event的权限
grant event on blog_db.* to blog_db@'%'
 flush privileges;
  1. 授权 blog_db在其他机器上登陆
update user set host = '%' where user = 'blog_db';
FLUSH PRIVILEGES;

错误: 错误号码2058 Plugin caching_sha2_password could not be loaded

image.png
ALTER USER 'blog_db'@'%' IDENTIFIED WITH mysql_native_password BY '';

错误:错误代码: 1142
CREATE command denied to user

ALTER USER 'blog_db'@'%' IDENTIFIED WITH mysql_native_password BY

相关文章

网友评论

      本文标题:mysql错误码1130 host is not allowed

      本文链接:https://www.haomeiwen.com/subject/kjkcaktx.html