Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

记录mysql远程连接数据库1130错误解决方法 #207

Open
confidence68 opened this issue Jun 30, 2016 · 0 comments
Open

记录mysql远程连接数据库1130错误解决方法 #207

confidence68 opened this issue Jun 30, 2016 · 0 comments

Comments

@confidence68
Copy link
Owner

confidence68 commented Jun 30, 2016

问题

最近倒腾linux,现在感觉操作起来比较熟练了。但是今天链接远程的mysql的时候,发现“错误代码1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server”,通过字面意思知道是因为我的没有链接mysql服务器的权限。记得之前在公司链接的时候,也曾经出现过这个问题,不过,是领导或者运维帮忙刷了权限。当时感觉很神奇,究竟怎么刷权限?他们是如何操作的,自己因为没有接触到这一块,因此一直也没有操作过。今天,我来把这个刷权限的过程给记录一下!还是那句话,“难了不会,会了不难”,其实这个很简单。

解决方法

假如你的mysql是在环境变量中配置了,也就是前面我讲的profile,关于环境变量,请看:http://www.haorooms.com/post/linux_path_commond

那么直接运行如下命令:

mysql -u root -p

弹出Enter password:输入您的数据库密码

链接到mysql数据库。

假如你的用户是root ,那么运行如下命令:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '您的数据库密码' WITH GRANT OPTION;

然后刷新一下权限

flush privileges;

大功告成,就可以在客户端链接你远程的mysql服务器了。

操作图

enter image description here

Navicat链接效果图如下:

enter image description here

@confidence68 confidence68 changed the title 尊重版权,拿别人东西说自己的东西的人是可耻的! 记录mysql远程连接数据库1130错误解决方法 Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant