phpMyAdmin is throwing a #2002 cannot log in to the mysql server phpmyadmin

前端 未结 27 1904
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 14:50

I have installed MySQL server enterprise 5.1 on my local machine and now I want to install phpMyAdmin, but it does not work.

I have unrared phpMyAdmin to my server r

相关标签:
27条回答
  • 2020-11-27 14:58

    After trying all of the above suggestions here is what fixed my #2002 error.

    Add the following line to your config.inc.php file and change the number to your MySQL port:

    $cfg['Servers'][$i]['port'] = '3307'; // MySQL port
    

    I had multiple mysql instances installed, and in this case, I had updated my.ini to run MySQL on port 3307, but had not updated phpMyAdmin to reflect the new port. In my case, the line for the port did not exist in the config.inc.php file, so I was not aware that it needed updating.

    0 讨论(0)
  • 2020-11-27 14:59

    I've been through basically all of stackoverflow for this error and nothing resolved my issue. I was able to log into mysql directly from the linux command line fine, but with the same user and password couldn't log into phpmyadmin.

    So I beat my head against the wall for half the day until I realized it wasn't even reading the config.inc.php under /etc/phpmyadmin (the only place it was located btw based on "find / -iname config.inc.php". So I changed the host in /usr/share/phpMyAdmin/libraries/config.default.php and it finally worked.

    I know there's probably another issue with why it isn't reading the config from the /etc/phpmyadmin folder but I can't be bothered with that for now :P

    tldr; if your settings don't seem to be applying at all try making the changes within /usr/share/phpMyAdmin/libraries/config.default.php

    0 讨论(0)
  • 2020-11-27 15:02

    Background: I am using Linux Mint 13. In my case, this error happened when I restarted the computer and my DHCP assigned a new local IP address (from 192.168.0.2 to 192.168.0.4) to my desktop.

    sudo gedit /etc/mysql/my.cnf
    

    Update

    bind-address = 192.168.0.2
    

    to

    bind-address = localhost
    

    This fixed the problem. Enjoy.

    0 讨论(0)
  • 2020-11-27 15:02

    I had same issue after the server has been attacked using a DDoS (actually a penetration testing tool).

    I've headed to /etc/var/mysql/error.log first to see the InnoDB had a file lock.

    The issue was immediately fixed by restarting the server, however that's not future-proof.

    0 讨论(0)
  • 2020-11-27 15:04

    my problem is solved by this step

    1. apt-get install mysql-server phpmy admin
    2. /etc/init.d/mysql restart
    3. done.
    0 讨论(0)
  • 2020-11-27 15:04

    For Ubuntu 14.04 and 16.04, you can apply following commands

    First, check MySQL service is running or not using

    sudo service mysql status

    Now you can see you show a message like this: mysql stop/waiting.

    Now apply command: sudo service mysql restart!

    Now you can see you show a message like this: mysql start/running, process 8313.

    Now go to the browser and logged in as root(username) and root(password) and you will be logged in successfully

    0 讨论(0)
提交回复
热议问题