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

前端 未结 27 1818
爱一瞬间的悲伤
爱一瞬间的悲伤 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 15:05

    In my system, config.inc.php didn't exist, but config.sample.inc.php existed. Try copying the sample script to config.inc.php

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

    For me the problem was solved by deleting a .pid file named after my computer:

    sudo rm /var/mysql/computername.pid
    
    0 讨论(0)
  • 2020-11-27 15:08

    Did you set up the MySQL on your machine? It sounds like you're using Windows; MySQL runs as a "Service" on your machine (right-click My Computer -> Manage -> Services).

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

    For those who get this error when working with WAMP/XAMP on a windows machine.

    This may help you.

    Your solution is to

    • net stop mysql
    • Erase binary logs (and the binary log index file)
    • IF you do not know where they are, locate my.ini on your PC
    • Open my.ini in Notepad look for the option log-bin or log_bin
    • Look for the option datadir
    • If log-bin only has a filename, look inside the folder specified by datadir
    • If log-bin includes a path and a filename, look inside the folder specified by log-bin
    • Open the desired folder in Windows Explorer
    • Remove the binary logs There should be a file whose file extension is .index. Delete this as well net start mysql

    Please DO NOT ERASE ib_logfile0 or ib_logfile1 when you have binary log issues.

    Answer is on dba.stackexchange

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

    This problem occurs when you already had MySQL installed on your machine or in case you have changed the post number of the MySql service which is 3306(Default). In order to solve this, you have to tell the phpMyAdmin to look for another port instead of 3306. To do so go to C:\xampp\phpMyAdmin(default location) and open Config.inc and add this line $cfg['Servers'][$i]['port'] = '3307'; after $cfg['Servers'][$i]['AllowNoPassword'] = true; Restart the services and now it should work.

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

    After Many attempts in getting this fixed, it was found out that the issue was with Mysql users not being allowed to login

    netstat -na | grep -i 3306
    

    If it is listening on all interfaces, then you can assign any of your interfaces to this

    $cfg['Servers'][$i]['host'] = 'ANY INTERFACE';
    

    Try to Login using the above IP using the comand line

    mysql -u bla -p -h <Above_IP_address>
    

    If this works then your phpmyadmin will also work, If not fix the mysql.user table so that the above command works and allows you to login to mysql.

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