Discussion:
Naive User
(too old to reply)
pinnerite
2022-01-15 22:56:05 UTC
Permalink
When I try to start MySQL from a Linux Mint 20.3 terminal, it returns this:

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

I cannot find any configuration file that points to that address.

How does MySQL know to look there?
--
Mint 20.3, kernel 5.4.0-95-generic, Cinnamon 5.2.7
running on an AMD Phenom II X4 Black edition processor with 16GB of DRAM.
J.O. Aho
2022-01-15 23:44:44 UTC
Permalink
Post by pinnerite
ERROR 2002 (HY000): Can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock
I cannot find any configuration file that points to that address.
How does MySQL know to look there?
The mysql daemon hasn't been started

sudo systemctl start mysql

if you want it to be automatically started after each reboot, then run this:

sudo systemctl enable mysql
--
//Aho
pinnerite
2022-01-16 09:18:02 UTC
Permalink
On Sun, 16 Jan 2022 00:44:44 +0100
Post by J.O. Aho
Post by pinnerite
ERROR 2002 (HY000): Can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock
I cannot find any configuration file that points to that address.
How does MySQL know to look there?
The mysql daemon hasn't been started
sudo systemctl start mysql
sudo systemctl enable mysql
--
//Aho
That still doesn't answer my question.

What directs MySQL to look to var/run/mysqld to locate the socket file?

Alan
--
Mint 20.3, kernel 5.4.0-95-generic, Cinnamon 5.2.7
running on an AMD Phenom II X4 Black edition processor with 16GB of DRAM.
The Natural Philosopher
2022-01-16 09:59:57 UTC
Permalink
Post by pinnerite
On Sun, 16 Jan 2022 00:44:44 +0100
Post by J.O. Aho
Post by pinnerite
ERROR 2002 (HY000): Can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock
I cannot find any configuration file that points to that address.
How does MySQL know to look there?
The mysql daemon hasn't been started
sudo systemctl start mysql
sudo systemctl enable mysql
--
//Aho
That still doesn't answer my question.
What directs MySQL to look to var/run/mysqld to locate the socket file?
Alan
On my system:

$cd /etc/mysql
$ grep sock *.cnf */*.cnf

mysql.conf.d/mysqld.cnf:# socket = /var/run/mysqld/mysqld.sock

But I think its a compiled in default. That can be changed there.
--
In todays liberal progressive conflict-free education system, everyone
gets full Marx.
pinnerite
2022-01-16 22:05:17 UTC
Permalink
On Sun, 16 Jan 2022 09:59:57 +0000
Post by The Natural Philosopher
Post by pinnerite
On Sun, 16 Jan 2022 00:44:44 +0100
Post by J.O. Aho
Post by pinnerite
ERROR 2002 (HY000): Can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock
I cannot find any configuration file that points to that address.
How does MySQL know to look there?
The mysql daemon hasn't been started
sudo systemctl start mysql
sudo systemctl enable mysql
--
//Aho
That still doesn't answer my question.
What directs MySQL to look to var/run/mysqld to locate the socket file?
Alan
$cd /etc/mysql
$ grep sock *.cnf */*.cnf
mysql.conf.d/mysqld.cnf:# socket = /var/run/mysqld/mysqld.sock
But I think its a compiled in default. That can be changed there.
It does look like it. Thanks.
--
Mint 20.3, kernel 5.4.0-95-generic, Cinnamon 5.2.7
running on an AMD Phenom II X4 Black edition processor with 16GB of DRAM.
Loading...