mysql administrator root打不开_MySQL Administrator无法连接服务器的解决方法

本文指导如何在Linux MySQL中修改默认的localhost限制,允许'root'用户从%(所有主机)访问,解决MySQL Administrator连接问题。通过查看user表并执行Grant语句,确保远程连接权限。
摘要由CSDN通过智能技术生成

默认情况下Linux内的mysql数据库mysql.user表内的用户权限只是对localhost即本机才能登陆。所以需要更改权限,否则无法使用Mysql Administrator连接服务器,会发生如下所示的错误:

MySQL Administrator 1.1.9配置,连接mysql数据库

Could not connect to the specified instance

MySQL Error Number 1130

Host '192.168.1.51' is not allowed to connect to this MySQL server

if you want to check the net connection , please click the ping buttion

解决的方法,首先按照如下的方式确认服务器上的user表中的权限设置,执行命令:

root#mysql -h localhost-u mysql -p

Enter password:    ******

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4 to server version: 4.0.20a-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;   (此DB存放MySQL的各种配置信息)

Database changed

mysql> select host,user from user; (查看用户的权限情况)

+-------------+-------+

| host            | user    |

+-------------+-------+

| localhost      |           |

| localhost      | root   |

| localhost      |           |

| localhost      | mysql |

+-------------+-------+

6 rows in set (0.02 sec)

由此可以看出,目前只能以localhost的主机方式访问。解决方法就是修改权限,执行如下命令:

mysql> Grant all privileges on *.* to 'root'@'%' identified by ‘password’ with grant option;

相应参数的解释如下:

all privileges 是�

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值