MySQL 打开phpMyAdmin时拒绝访问
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11702051/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Access Denied when opening phpMyAdmin
提问by user1559755
What could be the problem of my mysql database server in WAMP.
我的 mysql 数据库服务器在 WAMP 中可能有什么问题。
I can't open it. The error says:
我打不开 错误说:
MySQL said: Documentation
#2002 - No connection could be made because the target machine actively refused it.
The server is not responding (or the local server's socket is not correctly configured).
I checked the ports, but no other apps are using port 3306 which is dedicated to mysqld.
我检查了端口,但没有其他应用程序使用专用于 mysqld 的端口 3306。
Here's what mysql.log
says:
内容如下mysql.log
:
120728 22:34:40 [Note] Plugin 'FEDERATED' is disabled.
120728 22:34:42 InnoDB: The InnoDB memory heap is disabled
120728 22:34:42 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 22:34:42 InnoDB: Compressed tables use zlib 1.2.3
120728 22:34:43 InnoDB: Initializing buffer pool, size = 128.0M
120728 22:34:43 InnoDB: Completed initialization of buffer pool
120728 22:34:44 InnoDB: highest supported file format is Barracuda.
120728 22:34:52 InnoDB: Waiting for the background threads to start
120728 22:34:53 InnoDB: 1.1.8 started; log sequence number 74876578
wampmysqld: File '.\mysql-bin.000025' not found (Errcode: 2)
120728 22:34:53 [ERROR] Failed to open log (file '.\mysql-bin.000025', errno 2)
120728 22:34:53 [ERROR] Could not open log file
120728 22:34:53 [ERROR] Can't init tc log
120728 22:34:53 [ERROR] Aborting
120728 22:34:53 InnoDB: Starting shutdown...
120728 22:34:53 InnoDB: Shutdown completed; log sequence number 74876578
120728 22:34:53 [Note] wampmysqld: Shutdown complete
120728 22:35:16 [Note] Plugin 'FEDERATED' is disabled.
120728 22:35:16 InnoDB: The InnoDB memory heap is disabled
120728 22:35:16 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 22:35:16 InnoDB: Compressed tables use zlib 1.2.3
120728 22:35:16 InnoDB: Initializing buffer pool, size = 128.0M
120728 22:35:16 InnoDB: Completed initialization of buffer pool
120728 22:35:16 InnoDB: highest supported file format is Barracuda.
120728 22:35:32 InnoDB: Waiting for the background threads to start
120728 22:35:33 InnoDB: 1.1.8 started; log sequence number 74876578
wampmysqld: File '.\mysql-bin.000025' not found (Errcode: 2)
120728 22:35:33 [ERROR] Failed to open log (file '.\mysql-bin.000025', errno 2)
120728 22:35:33 [ERROR] Could not open log file
120728 22:35:33 [ERROR] Can't init tc log
120728 22:35:33 [ERROR] Aborting
120728 22:35:33 InnoDB: Starting shutdown...
120728 22:35:34 InnoDB: Shutdown completed; log sequence number 74876578
120728 22:35:34 [Note] wampmysqld: Shutdown complete
120728 22:35:42 [Note] Plugin 'FEDERATED' is disabled.
120728 22:35:42 InnoDB: The InnoDB memory heap is disabled
120728 22:35:42 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 22:35:42 InnoDB: Compressed tables use zlib 1.2.3
120728 22:35:42 InnoDB: Initializing buffer pool, size = 128.0M
120728 22:35:42 InnoDB: Completed initialization of buffer pool
120728 22:35:44 InnoDB: highest supported file format is Barracuda.
120728 22:35:59 InnoDB: Waiting for the background threads to start
120728 22:36:00 InnoDB: 1.1.8 started; log sequence number 74876578
wampmysqld: File '.\mysql-bin.000025' not found (Errcode: 2)
120728 22:36:00 [ERROR] Failed to open log (file '.\mysql-bin.000025', errno 2)
120728 22:36:00 [ERROR] Could not open log file
120728 22:36:00 [ERROR] Can't init tc log
120728 22:36:00 [ERROR] Aborting
120728 22:36:00 InnoDB: Starting shutdown...
120728 22:36:01 InnoDB: Shutdown completed; log sequence number 74876578
120728 22:36:01 [Note] wampmysqld: Shutdown complete
PS: I don't have a Skype. So i think it's not the conflict. Please Help.
PS:我没有Skype。所以我认为这不是冲突。请帮忙。
回答by saleh
This works:
这有效:
- Stop the MySQL service
- Open data folder
- Remove both ib_logfile0 and ib_logfile1
- Restart the service
- 停止 MySQL 服务
- 打开数据文件夹
- 删除 ib_logfile0 和 ib_logfile1
- 重启服务
回答by Adi
回答by Juan Mendez
I experienced this problem this morning for the first time while using mysql/easyphp. I tried clearing the contents of mysql-bin.index but that didn't work for me.
我今天早上在使用 mysql/easyphp 时第一次遇到这个问题。我尝试清除 mysql-bin.index 的内容,但这对我不起作用。
I restarted the computer and tried accessing mysql again and had no more issues.
我重新启动计算机并再次尝试访问 mysql 并且没有更多问题。
回答by Muhammad Ali
I stopped mysql by
我停止了mysql
sudo service mysql stop
and then started lampp using:
然后使用以下命令启动lampp:
sudo /opt/lampp/lampp start
And everything works fine
一切正常
回答by mnik
I had similar error. Disconnect from internet, access phpmyadmin, then reconnect internet. This solved my problem.
我有类似的错误。断开互联网连接,访问 phpmyadmin,然后重新连接互联网。这解决了我的问题。
回答by iComet Nashik
I found that there are some temporary log files are created in the windows temp directory. If the log file limit has exceeded and there is no more space available from windows to write in that log file, it fires an error of access denied. Clear files from the temp directory can solve it.
我发现在 windows temp 目录中创建了一些临时日志文件。如果已超出日志文件限制并且 Windows 没有更多空间可用于写入该日志文件,则会触发访问被拒绝错误。从临时目录中清除文件可以解决它。
In windows 7, follow the process.
在 Windows 7 中,按照该过程进行操作。
Run >> type %temp%
and hit enter >> Select all files and delete >>
Restart WAMP and access PHPMyAdmin.
运行 >> 输入%temp%
并按回车 >> 选择所有文件并删除 >> 重新启动 WAMP 并访问 PHPMyAdmin。
回答by Abu Shumon
I have been through the exact same situation. Read loads of blog and posts. So far my understanding is that it happens mostly because of permission issues. Ubuntu/Linux deals directory access and their permissions very strictly.
我经历过完全相同的情况。阅读大量博客和帖子。到目前为止,我的理解是它的发生主要是因为权限问题。Ubuntu/Linux 非常严格地处理目录访问及其权限。
Find out where is mysql
directory is, then give it proper access right n permission
. refresh you localhost/phpmyadmin
it should be working now.
找出mysql
目录在哪里,然后给它适当的access right n permission
. 刷新你localhost/phpmyadmin
它现在应该可以工作了。
In my case I did following according this blog:
就我而言,我根据此博客进行了以下操作:
sudo chown -R mysql.mysql /opt/lampp/var/mysql
- Please notice here that in the blog it says mysql directory in
/var/lib/mysql
- But actually directory in my machine was
/opt/lampp/var/mysql
- 请注意,在博客中它说mysql目录在
/var/lib/mysql
- 但实际上我机器中的目录是
/opt/lampp/var/mysql
So directories can differ. Therefore, point out right directory and give it proper access. It should be working fine after unless there isn't any hidden error attached to it.
所以目录可以不同。因此,指出正确的目录并赋予其适当的访问权限。除非没有附加任何隐藏错误,否则它应该可以正常工作。
回答by clonea
I copied my mysql files (the whole directory structure), from one unix computer to another unix computer. Even though the mysql server was completely off, when I made the copy, I could not get it to start up on the 2nd computer.
我将我的 mysql 文件(整个目录结构)从一台 unix 计算机复制到另一台 unix 计算机。即使 mysql 服务器完全关闭,当我进行复制时,我也无法在第二台计算机上启动它。
I had an error "File ./mysql-bin.000532 not found Errorcode: 2" Since I had the whole thing backed up, I could afford to delete pieces without any impact. In other words, I can't make it any more DEAD. And I can restore any file I trashed.
我有一个错误“File ./mysql-bin.000532 not found Errorcode: 2”因为我备份了整个东西,所以我可以在没有任何影响的情况下删除片段。换句话说,我不能让它再死了。我可以恢复我丢弃的任何文件。
From digging on the internet, I found that if I remove ib_logfile0 and ib_logfile1, mysql will attempt to recreate them from scratch. This seemed to move it along. However, it still asked for and failed to find that mysql-bin.000532. In THIS forum I see that file mysql-bin.index is just a text file holding onto all of these mysql-bin.####### files. Emptying it means I will not be looking for missing files. Great. Now it comes up fine.
通过在互联网上挖掘,我发现如果我删除 ib_logfile0 和 ib_logfile1,mysql 将尝试从头开始重新创建它们。这似乎推动了它。但是,它仍然要求并没有找到mysql-bin.000532。在这个论坛中,我看到文件 mysql-bin.index 只是一个包含所有这些 mysql-bin.####### 文件的文本文件。清空它意味着我不会寻找丢失的文件。伟大的。现在它出现了。
But think about it. There is a reason for those files I am sure. It is holding onto changes to data. What if you had changes that were not actually dropped to disk? You would lose them. As I said at the start, this is a copy of mysql with it completely OFF. So all of MY changes are in. So I am good to go.
但想想吧。我确信这些文件是有原因的。它正在坚持对数据的更改。如果您的更改实际上并未删除到磁盘,该怎么办?你会失去他们。正如我在开始时所说的,这是一个完全关闭的 mysql 副本。所以我所有的改变都在。所以我很高兴去。
Last thing, I am sure this is covered in some mysql documentation somewhere. I just have not found it yet. My actions were based on guesses and experimentation.
最后一件事,我确定这在某处的某些 mysql 文档中有所涉及。我只是还没有找到它。我的行动是基于猜测和实验。
回答by mavrosxristoforos
I had the same problem, and I tried all previous suggestions, above.
Finally the problem for me, was related to the hosts file, something I had previously added trying to solve another related issue.
我遇到了同样的问题,我尝试了上面所有以前的建议。
最后,我的问题与主机文件有关,这是我之前为解决另一个相关问题而添加的内容。
回答by Govind Totla
I am also facing this issue, But disabling firewall resolved this. But any other approach to solve it ? I dont think that this would be a good solution to run mysql. but till then we can use mysql by disabling firewall.
我也面临这个问题,但是禁用防火墙解决了这个问题。但是还有其他解决方法吗?我认为这不是运行 mysql 的好方法。但在那之前我们可以通过禁用防火墙来使用 mysql。