0
votes

The client doesn't in work running Ubuntu.

mysql -u root -p gives

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

Messed up the mysql-community installation, first did

tar --strip-components=1 -XJf /usr/home/lasse/mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz

at /usr/local

Couldn't start mysqld so I abandoned it and downloaded the Debian bundle.

Installed the client and the server and several other dependent packages with sudo dpkg -i, and finally got mysqld up and running somehow but I cannot connect to it. Reading ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) gives that I should have a /etc/my.cnf, so I copied it from /etc/mysql/my.cnf What should I try next?

1

1 Answers

0
votes

In /etc/my.cnf you should have:

[client]
socket=/var/lib/mysql/mysql.sock
[mysqld]
socket=/var/lib/mysql/mysql.sock

(or other, but the same for both sections file) or have in the file

[client]
port = 3306
[mysqld]
port = 3306

This will make client to connect to server via socket (first case) or via TCP port