Access Denied when opening phpMyAdmin

对着背影说爱祢 提交于 2019-11-27 01:55:50

问题


What could be the problem of my mysql database server in 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.

Here's what mysql.log says:

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.


回答1:


This works:

  1. Stop the MySQL service
  2. Open data folder
  3. Remove both ib_logfile0 and ib_logfile1
  4. Restart the service



回答2:


Go to your MySQL directory and find mysql-bin.index then clear its content. Everything should work fine after that.

Source




回答3:


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.

I restarted the computer and tried accessing mysql again and had no more issues.




回答4:


I stopped mysql by

sudo service mysql stop

and then started lampp using:

sudo /opt/lampp/lampp start

And everything works fine




回答5:


I had similar error. Disconnect from internet, access phpmyadmin, then reconnect internet. This solved my problem.




回答6:


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.

In windows 7, follow the process.

Run >> type %temp% and hit enter >> Select all files and delete >> Restart WAMP and access PHPMyAdmin.




回答7:


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.




回答8:


Maybe mysql is not configured to accept remote connections?

try the following:

Open your my.cnf (/etc/mysql/my.cnf usually) and change the line that says

bind = 127.0.0.1

(If present) to your network ip.

Restart mysqld after that change.




回答9:


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.

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.

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.

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.

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.




回答10:


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.




回答11:


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.

Find out where is mysql directory is, then give it proper access right n permission. refresh you localhost/phpmyadmin it should be working now.

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

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.




回答12:


I know it is a quite old question. But given that I have faced the same issue the other day as of 2017, which really freaked me out. I thought this may help some people.

I'm assuming you faced the issue possibly because of a recent update of the database.

If that's the case, please simply do the following three steps:

  1. Disconnect from your internet.
  2. Access your MySQL offline as usual.
  3. Once you have logged in MySQL, you can reconnect to the Internet.

Everything should work just fine.




回答13:


when I turned off my McAfee Firewall the problem was fixed

what I need to change in McAfee settings

Firewall -> Settings -> Program Permissions -> Apache HTTP Server -> need to be set to Full or Outgoing




回答14:


I'm having the same problem with Wampserver. It’s worked for me:

You must change this file: "C:\wamp\bin\mysql[mysql_version]\my.ini"

For example: "C:\wamp\bin\mysql[mysql5.6.12]\my.ini"

And change default port 3306 to 80. (Lines 20 & 27, in both)

port = 3306 To port = 80

I hope this is helpful.




回答15:


Sometimes you might have multiple webservers running i.e. apache2 and nginx concurrently on same location but different ports. I suggest stopping apache2 or nginx and then restarting the one you prefer before deleting any files. This approached worked for me.




回答16:


I installed MySQL stand-alone (not using any XAMPP/WAMP stack) and got this problem some time ago. I just ran the following command in windows command prompt:

C:\>"C:\mysql\bin\mysqld" --console

where "C:\mysql\" is the installation directory (adjust the path according to your own case). The

  --console

displays the process for debugging purposes.

After startup, you should see something like:

C:\mysql\bin\mysqld: ready for connections
Version: '5.7.10'  socket: ''  port: 3306

For moore, see Starting MySQL Server




回答17:


i had the same problem and these step worked for me

  1. open services
  2. stop MySQL[version] service
  3. open mysql properties
  4. if you did a manual install of MySQL (ie not using xampp wamp etc.) then you may want to change startup type to automatic
  5. go to the log in tab
  6. select local system account
  7. press ok
  8. start the service again

MySQL57 properties screenshot

if you upvote me i can add the photo inline




回答18:


Well, I had the same issue, I searched on google for any better solution but i found nothing helpful. So, what I did, is: Unistall Wamp, delete the wamp folder from C and reinstalled wamp again. I KNOW is not the best solution but it's still the one that worked for me.




回答19:


you can solve this problem useing just reboot your system.

In ubuntu you can use

reboot


来源:https://stackoverflow.com/questions/11702051/access-denied-when-opening-phpmyadmin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!