Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2825

How to diagnose/fix mysql install issue returning "error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)'"?

$
0
0

I'm getting the following error for a couple of commands I'm trying to run AND I don't know the password whenever I'm prompted for that. (note: I just updated my ubuntu distribution, but I previously didn't have a password set/had an empty password for 'root').

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)'

It seems from most posts that the common issue is that mysql-server isn't actually running.I can see that mine is running, though, with sudo service mysql status and the following commands return...

$ cat /etc/services | grep 3306    mysql           3306/tcp$  netstat -tulpn | grep 3306    (No info could be read for "-p": geteuid()=1000 but you should be root.)    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -    tcp        0      0 127.0.0.1:33060         0.0.0.0:*               LISTEN  

These commands are giving the "Can't connect..." error:

  • mysqladmin -u root -p shutdown
  • mysqladmin version
  • mysql
  • mysql -u root
  • mysql -u root -h localhost -p

Running mysql -u root -h 127.0.0.1 -p seems to work in that it prompts me for a password, but none of my prior passwords are working and I have not been able to run sudo mysqld_safe --skip-grant-tables & successfully to reset the root password.

I have also run...

  • sudo mysqld_safe --skip-grant-tables &
  • sudo apt-get install --reinstall mysql-server
  • sudo apt update
  • sudo apt upgrade
  • sudo apt install mysql-server
  • sudo apt install mysql-client
  • sudo usermod -d /var/lib/mysql/ mysql
  • sudo dpkg --configure -a

I also know that /var/run/mysqld/mysqld.sock exists, but when I run sudo find / -type s, it just returns a bunch of files/directories with "Permission Denied" (I assume because I'm in WSL), so I haven't checked that there could be another mysql.sock somewhere.

I also know that /etc/mysql/my.cnf is just pointing to -> /etc/alternatives/my.cnf, which only has the following in it (other than some comments):

!includedir /etc/mysql/conf.d/!includedir /etc/mysql/mysql.conf.d/

Viewing all articles
Browse latest Browse all 2825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>