mysql错误码1130 host is not allowed to connect to this mysql server

错误信息:

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
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容