2

I updated my ubuntu from 18.04 to 20.04, and mysql is not working any more. Phpmyadmin says mysqli_real_connect(): (HY000/2002): No such file or directory .

What should i do?

Thanks in advance.

15:23:36 j0 wormball@wormball-desktop:~$ sudo service mysql stop 
15:23:47 j0 wormball@wormball-desktop:~$ sudo service mysql start 
15:23:49 j0 wormball@wormball-desktop:~$ systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql database server daemon
     Loaded: loaded (/etc/init.d/mysql; generated)
     Active: active (exited) since Wed 2020-10-14 15:23:49 MSK; 1s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1159338 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)

окт 14 15:23:49 wormball-desktop systemd[1]: Starting LSB: Start and stop the mysql database server daemon...
окт 14 15:23:49 wormball-desktop systemd[1]: Started LSB: Start and stop the mysql database server daemon.
15:23:51 j0 wormball@wormball-desktop:~$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
15:24:40 j0 wormball@wormball-desktop:~$ mysqladmin -u root -p status
Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

15:13:29 j0 wormball@wormball-desktop:~$ cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

!includedir /etc/mysql/conf.d/

15:14:59 j0 wormball@wormball-desktop:~$ cat /etc/mysql/conf.d/*
[mysql]
[mysqld_safe]
syslog
[mysqldump]
quick
quote-names
max_allowed_packet  = 16M```

1 Answer 1

0

It turned out that mysql-server was not installed.

sudo apt install mysql-server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.