Connection Mysql error ERROR 2002 (HY000)

1.Mysql has been installed and DB driver has been installed successfully. Failed when trying to connect to the database

ERROR 2002 (HY000)Can"t connect to local MySQL server through socket "/tmp/mysql.sock" (2)

tried:

mysql start

ERROR 2002 (HY000): Can"t connect to local MySQL server through socket"/ tmp/mysql.sock" (2)

mysql -uroot

ERROR 2002 (HY000): Can"t connect to local MySQL server through socket"/ tmp/mysql.sock" (2)

mysql -h localhost

ERROR 2002 (HY000): Can"t connect to local MySQL server through socket"/ tmp/mysql.sock" (2)

mysql -h 127.0.0.1

ERROR 2003 (HY000): Can"t connect to MySQL server on "127.0.0.1" (61)
then go to the temp folder where there is no target file at all

/tmp/mysql.sock

use the find command:

find / -name mysql.sock

both:

Permission denied

many people failed to find it on the Internet. Thank you

for asking for help.
May.16,2022

vi / etc/mysql.cnf

check whether the paths configured by socket under [mysqld] and [mysql] tags are consistent

restart mysql after modification

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e877d7-e5f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e877d7-e5f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?