×

mysql无法远程登录

shmily shmily 发表于2024-12-29 21:28:43 浏览59 评论0

抢沙发发表评论

在ubuntu里面安装好了mysql,使用DataGrip软件发现无法远程登录mysql数据库,一直提示报错。

登录mysql,使用命令查看

select host,user from user;


image-20240530012344-oijimem.png

root用户的host,权限是localhost,只能本地登录。

使用命令

update user set host='%' where user='root';


image-20240530012530-mgulbnz.png


更新root用户的host为%,即可!

刷新权限,flush privileges;

image-20240530012540-ye3x6a2.png


image-20240530012552-br3w5hu.png


DataGrip登录mysql成功↓

image-20240530012636-fyfauln.png

评论列表

访客