I have issues resetting the root password for my mysql server on Ubuntu 19.10: I followed the instructions on https://websiteforstudents.com/resetting-mysql-root-password-on-ubuntu-16-04-17-10-and-18-04-lts/ and everything goes like the instructions say until I get to the step where I'm supposed to login with sudo mysql -u root
. I get the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I checked my bind-addresses in /etc/mysql/mysql.conf.d/mysqld.cnf
. I have three, they are set to:
127.0.0.1,
10.0.2.15 (my local ethernet iface) and
0.0.0.0
so i don't know why it doesn't let me connect, any hints? I have set sudo ufw enable
& sudo ufw allow mysql
- even after sudo ufw disablle
it won't let me connect!
At a guess, I would say that you are not trying to connect to what you think you are. Try adding the --host=127.0.0.1 --port=3306
to explicitly set the host/port you are trying to connect to.
Also, increase verbosity with -vvv
Check that mysqld is actually listening with
sudo ss -nlpt | grep -i mysqld
Permit all traffic on port 3306:
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments