远程连接MariaDB报错——1130 - Host '192.168.64.1' is not allowed to connect to this MariaDB server
程序员文章站
2022-07-15 07:54:08
...
1 错误
1130 - Host ‘192.168.64.1’ is not allowed to connect to this MariaDB server
2 解决办法
登陆本地的mysql
mysql -u root -p
使用数据库:
use mysql;
搜索账户:
select host from user where user='root';
更改内容
update user set host = '%' where user ='root';
如出现问题,说明host已经有了%这个值,不用管,继续执行下面的步骤:
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
刷新配置:
flush privileges;
然后连接成功:
完整命令截图: