ERROR 2002 (HY000): Can't connect to local MySQL srever through socket '/var/lib/mysql/mysql.sock'

17
17



Hi Friends,
In this video we are going to see a very easy solution for Mysql server socket error, Most of the time mysql service won’t start due to this error. Here you can find a simple solution for that.

ERROR 2002 (HY000): Can’t connect to local MySQL srever through socket ‘/var/lib/mysql/mysql.sock’ (2) | Mysql server Error 2002 |

access denied for user ‘root’@’localhost’ (using password yes)
error 1045 (28000): access denied for user ‘root’@’localhost’ (using password: yes)
error 1045 access denied for user ‘root’@’localhost’ using password no
error 1045 (28000): access denied for user ‘root’@’localhost’ (using password: no)
access denied for user ‘root’@’localhost’ (using password no)
error 1045 access denied for user ‘root’@’localhost’ using password yes
access denied for user ‘root’@’localhost’ (using password: yes)
access denied for user ‘root’@’localhost’
mysqli_real_connect(): (hy000/1045): access denied for user ‘root’@’localhost’ (using password: yes)
1045
mysqli_real_connect(): (hy000/1045): access denied for user ‘root’@’localhost’ (using password: no)
mysqli_real_connect(): (hy000/1045): access denied for user ‘pma’@’localhost’ (using password: no)
mysql access denied for user ‘root’@’localhost’ (using password yes)
access denied for user ‘root’@’localhost’ (using password: no)
openwrt
could not connect: access denied for user ‘root’@’192.168.39.206’ (using password: yes)
error
my sql
error 2002 (hy000): can’t connect to local mysql server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
#1045 – access denied for user ‘odbc’@’localhost’ (using password: no)
[err] 1045 – access denied for user ‘root’@’localhost’ (using password: yes) [msg] finished – unsuccessfully
_mysql_exceptions.operationalerror (1045.”access denied for user ‘root’@localhost'(using password:no)”)
access denied for user ”@’localhost’ (using password no) in cmd
access denied for user ”@’localhost’ (using password no) in cmd for mysql
access denied for user ‘root’@’localhost’ (using password: no
cara mengatasi mysql error 1045 access denied for user ‘root’@’localhost’ (using password yes)
erreur 1045 mariabd on centos
error #1045
error 1045 (28000) when using mysql shell
error 1045 (28000): access denied for user ‘amin’@’localhost’ (using password: no)
error 1045 (28000): access denied for user ‘root’@’localhost’ windows
error 1045 access denied for user ‘root’@’localhost’
error in code access denied for user in sql cmd
error1045 mysql ubuntu
how to create root and password
mysql mac error 1045
mysql2::error: access denied for user ‘root@’localhost’ (using password: yes) on linux
mysql_upgrade access denied for user ‘root’@’localhost’
mysqld service failed to start in red hat
qlstate[28000] [1045] access denied for user ‘root’@’localhost’ (using password: no)
ubuntu 18.1 mysqli_real_connect(): (hy000/1045): access denied for user ‘phpmyadmin’@’localhost’ (using password: yes)
ubuntu error #1045 – access denied user

Nguồn: https://saesrpg.net/

Xem thêm bài viết khác: https://saesrpg.net/giai-tri/

17 comments

  1. VMAJSTER 8 July, 2020 at 08:32 Reply

    shorthand
    w/o sudo:
    touch /var/lib/mysql/mysql.sock && chown -R mysql:mysql /var/lib/mysql/mysql.sock && chmod 777 && service mysqld restart (but I recommend reboot)
    with sudo:
    sudo touch /var/lib/mysql/mysql.sock && sudo chown -R mysql:mysql /var/lib/mysql/mysql.sock && sudo chmod 777 && sudo service mysqld restart

  2. Helles Mammuth 8 July, 2020 at 08:32 Reply

    Hey, i followed the Videos instrutions until 1:50 ! Which password do you enter at that moment? My problem is, that while installing mysql i dont get a prompt to setup the root password!

  3. Hugh Smith 8 July, 2020 at 08:32 Reply

    I just upgraded my Macbook Pro to Catalina, and now from the command line:

    When I run "mysql", I get this error:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    When I run "service mysqld status", I get:
    zsh: command not found: service

    In laravel, I get:
    SQLSTATE[HY000] [2002] Connection refused

    Any ideas on how to get MySQL running again so I can connect? Any help would be much appreciated.

    Thanks!

  4. Tony Obioha 8 July, 2020 at 08:32 Reply

    Nice work, tried and it worked. Here’s another solution resource to this issue https://www.dailyrazor.com/blog/cant-connect-to-local-mysql-server-through-socket/

  5. Jahirul Islam Mamun 8 July, 2020 at 08:32 Reply

    For mamp, what is the process?

    I am getting following error–
    /Applications/MAMP/Library/bin/mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

  6. Manish kumar 8 July, 2020 at 08:32 Reply

    my mysqld service stops several times , when i start it goes up for a while and stops suddenly without any error

  7. crisdale cabanlit 8 July, 2020 at 08:32 Reply

    Hey! I can't start or restart my mysql. and i got this error
    — Unit mysql.service has begun starting up.
    Sep 05 01:13:17 digital audit[21280]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=21280 comm="mysqld" requested_mask="r" denied_ma
    Sep 05 01:13:17 digital kernel: audit: type=1400 audit(1536109997.788:1441): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=21280 comm="m
    Sep 05 01:13:17 digital audit[21285]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=21285 comm="mysqld" requested_mask="r" denied_ma
    Sep 05 01:13:17 digital kernel: audit: type=1400 audit(1536109997.836:1442): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=21285 comm="m
    Sep 05 01:13:19 digital sshd[21224]: Failed password for root from 122.226.181.167 port 46570 ssh2
    Sep 05 01:13:20 digital sshd[21222]: Received disconnect from 61.184.247.4 port 40643:11: [preauth]
    Sep 05 01:13:20 digital sshd[21222]: Disconnected from authenticating user root 61.184.247.4 port 40643 [preauth]
    Sep 05 01:13:20 digital sshd[21222]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.184.247.4 user=root
    Sep 05 01:13:21 digital sshd[21224]: Failed password for root from 122.226.181.167 port 46570 ssh2
    Sep 05 01:13:24 digital sshd[21303]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.34 user=root
    Sep 05 01:13:24 digital sshd[21301]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.184.247.4 user=root
    Sep 05 01:13:24 digital sshd[21224]: Failed password for root from 122.226.181.167 port 46570 ssh2
    Sep 05 01:13:25 digital sshd[21224]: Received disconnect from 122.226.181.167 port 46570:11: [preauth]
    Sep 05 01:13:25 digital sshd[21224]: Disconnected from authenticating user root 122.226.181.167 port 46570 [preauth]
    Sep 05 01:13:25 digital sshd[21224]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=122.226.181.167 user=root

  8. Ginko Green 8 July, 2020 at 08:32 Reply

    Hi, there. I can't execute service mysql restart
    It shows me this error.
    Job for mysql.service failed because the control process exited with error code.
    See "systemctl status mysql.service" and "journalctl -xe" for details.

Leave a reply