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

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

    This the following line in your php.ini file

    mysql.default_socket = "MySQL"
    

    to

    mysql.default_socket = /var/run/mysqld/mysqld.sock
    
    0 讨论(0)
  • 2020-11-27 15:12

    Just in case anyone has anymore troubles, this is a pretty sure fix.

    check your etc/hosts file make sure you have a root user for every host.

    i.e.

    127.0.0.1   home.dev
    
    localhost   home.dev
    

    Therefore I will have 2 or more users as root for mysql:

    root@localhost
    root@home.dev
    

    this is how I fixed my problem.

    0 讨论(0)
  • 2020-11-27 15:13
    • Right-click My Computer -> Manage -> Services
    • Choose "Services" under the "Services and Application" from right pane
    • Then search for the "Zend Development" Service.
    • When you find it, double click to start that service.

    Now, you should be able log in to phpMyAdmin.

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

    I have also experienced the same thing, hopefully a this helps.

    cd /etc/init.d
    ./mysql start
    

    please login to access mysql and phpmyadmin

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

    This can also be caused if you forget (as I did) to move config.inc.php into its proper place after completing the setup script.

    After making the config folder and doing chmod o+rw config and going to localhost/phpmyadmin/setup and following those steps, you need to go back to the command line and finish things off:

    mv config/config.inc.php .         # move file to current directory
    chmod o-rw config.inc.php          # remove world read and write permissions
    rm -rf config                      # remove not needed directory
    

    See full instructions at https://phpmyadmin.readthedocs.org/en/latest/setup.html

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

    CAUTION: This method completely removes MySQL data!

    I have same problem in Ubuntu 12.10 , mysql 5.5

    I have tested lots of answer related to my issue but none of theme work

    at last I had to reinstall remove my mysql server completely and then I install again Mysql server

    but you should be aware that you should delete all directory which related to Mysql I use this link to remove mysql completely

    sudo apt-get remove --purge mysql-server mysql-client mysql-common
    sudo apt-get autoremove
    sudo apt-get autoclean
    sudo deluser mysql
    sudo rm -rf /var/lib/mysql
    sudo rm -rf /etc/mysql
    sudo rm -rf /var/lib/mysql
    sudo rm -rf /var/run/mysqld
    

    and then you install again LAMP by tasksel

    Removing MySQL 5.5 Completely

    https://serverfault.com/questions/254629/unable-to-install-mysql-server-in-ubuntu/296928#296928

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