Linux Mysql 1130错误解决

来源:互联网 发布:云计算安全 编辑:程序博客网 时间:2024/05/01 23:39
Linux Mysql 1130错误解决
 
今天在win32下通过navicat 远程登录Mysql时出现如下错误:
 
 
想都不用想,肯定是Mysql的访问权限问题。
 
首先,通过终端(我用的是SSH)远程登录到Linux服务器,为了安全起见,先改一下Mysql数据的root用户密码:
 
?
1
2
3
4
5
6
7
8
9
10
11
[plain]
[hadoop@h1 ~]$ mysqladmin -u root password123456 
[hadoop@h1 ~]$ mysql -uroot -p 
Enterpassword
Welcometothe MySQL monitor.  Commands endwith ; or\g. 
Your MySQL connectionid is13 
Server version: 5.0.77 Source distribution 
   
Type'help;'or '\h' for help. Type '\c'to clear the buffer. 
   
mysql>
  
第二步,查询Mysql中所有用户的权限:
 
 
意料之中,mysql的root用户只能通过本机访问,下面我们来改一下权限:
 
?
1
2
3
[plain]
mysql>update`user`set`host` = '%'where `user` = 'root'
mysql> flush privileges;

 

 
测试一下,如图:
 
 
操作成功,现在,你可以通过终端远程管理mysql数据库了。
0 0
原创粉丝点击