主机"localhost"不允许连接到此MySQL服务器(#1130) [英] host 'localhost' is not allowed to connect to this MySQL server (#1130)

查看:1615
本文介绍了主机"localhost"不允许连接到此MySQL服务器(#1130)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我是在问这个问题,因为我尝试了最近4个小时的答案.
我什至不知道我在服务器上所做的事情,因为它不允许我从本地主机进行连接.但是即使在安装了与mysql安装相关的所有内容并仅重新安装服务器之后,它也无法连接.

Ok I'm asking this question since I tried looking for an answer for the last 4 hours.
I don't even know what I did in the server that it won't allow me to connect from the local host. but even after installing anything related to the mysql installation and reinstalling only the server it won't let me connect.

当我在应用安全性设置上安装服务器后尝试配置服务器时,它会失败并给我该错误.

when I try to configure the server after I just installed it on the apply security settings it fails and give me that error.

我的服务器安装在普通PC上,而不安装在任何网站上,PC运行win 7,我尝试了skip-grant-tables选项,并在卸载服务器后删除了注册表项.

My server is installed on a regular PC and not on any website, the PC runs a win 7 and I tried the skip-grant-tables option as well as the removing the registry keys after uninstalling the server.

如果有人有其他选择供我使用,或者您认为我在这些其他选择中做错了什么,请告诉我如何解决做对的事情以及如何做.

Please if anyone has any other option for me to use or if you think I did something wrong in these other options please tell me how can I fix that doing the right thing and how to do that.

推荐答案

在安装新版本的mysql5.5时,我也遇到了同样的问题,但是我解决了.

I also had this same problem when installing a new version of mysql5.5, but i solved it.

如果通过安装mysql的路径,则在Windows的Windows系统中,"c:\ mysqlinstalllocation \ bin" 您可以从该目录运行mysql查询, 但是,如果您已经在环境变量的Windows中的路径选项中添加了mysql命令,这将帮助您从命令行运行自定义命令,则可以直接在命令提示符下的任何目录中运行它.

If you go through the path mysql was installed in, in windows your windows system, "c:\mysqlinstalllocation\bin" you can run the mysql query from this directory, but if you have already added the mysql command to the path option in windows, in environment variables, which will help you run custom commands form the command line, you can run it directly from any directory in the command prompt.

只需在mysql.ini文件的[mysqld]标题下添加"skip-grant-tables"命令,并确保在执行此操作后重新启动服务器并运行mysql,它将起作用.此时,您将不使用任何密码登录,因此建议此时删除密码,这样,在取消注释"skip-grant-tables"命令

Just add the "skip-grant-tables" command under the [mysqld] heading in the mysql.ini file, and make sure to restart your server after doing this, and run mysql, it will work. At this point you will login without any password, so it's advisable to delete the password at this point, so you can login easily after you've uncomment the skip-grant-tables" command

从根用户删除密码后,请确保删除"skip-grant-tables"命令,或使用#将其注释掉,然后重新启动服务器.会起作用的.

And after you've removed the password from the root user, make sure to remove the "skip-grant-tables" command, or comment it out, with #, then restart your server. It will work.

现在,您无需输入任何密码即可登录,然后运行Grant命令并设置所需的任何密码.

Now you can login without any password, and run the grant command, and set any password you like.

这篇关于主机"localhost"不允许连接到此MySQL服务器(#1130)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆