Click here to Skip to main content
15,347,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I can't connect to a MySQL server, so I stopped MySQL with:


What I have tried:

sudo /etc/init.d/mysql stop

Quote:
# Stopping mysql (via systemctl): mysql.service.

sudo -s
mysqld_safe --skip-grant-tables &

Quote:
# .... mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
# 2021-05-29T03:01:11.967630Z mysqld_safe mysqld from pid file /var/lib/mysql...... ended

mysqld_safe --skip-grant-tables

Quote:
# Logging to '/var/lib/mysql/......err'.
# 2021-05-29T03:03:40.507375Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
# 2021-05-29T03:03:40.834556Z mysqld_safe mysqld from pid file /var/lib/mysql/...... ended
# [1]+ Done mysqld_safe --skip-grant-tables

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld
mysql -u root

Quote:
# ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900