mysql连接报错:ERROR 2002 (HY000):Can't connect to

2019-11-14 08:48发布

使用MySQL客户端连接远程amoeba进行远程控制数据库报错:

root@uduntu:~# mysql -u root -P8066  -h 172.18.0.4 -p
Enter password: 
ERROR 2002 (HY000): Can't connect to MySQL server on '172.18.0.4' (115)

求解答????在线等谢谢,可进行远程协调

2条回答
淡お忘
2楼-- · 2019-11-14 09:04

Maybe the root is not allowed to connect mysql server from a remoting host. I advise you to create a new user instead of root.

create user 'joey'@'%' identified by 'yourpassword';
grant all privileges on yourdb.* to 'joey'@'%'

you can replace '%' with your host(if not, connecting mysql server from every remoting host is allowed)

查看更多
我想做一个坏孩纸
3楼-- · 2019-11-14 09:15

要检查下 mysql服务是否开了远程权限

查看更多
登录 后发表回答