0

I upgraded OpenSSH with this command: sudo apt-get upgrade openssh-server

I rebooted the server and after that, I cannot connect to any database (WordPress database, you'll database, phpmyadmin database)

For WordPress I get: Error establishing a database connection

For yourls I get: Incorrect DB config, or could not connect to DB

For phpmyadmin I get: mysqli_real_connect(): (HY000/2002): No such file or directory

I think that it's a mysql problem because it does not start and when I check mysql.service I find that's failed

What's the solution please!

This is the error log /var/log/mysql/error.log

This is the error log /var/log/mysql/error.log

This is the error log /var/log/mysql/error.log

systemctl status mysql.service systemctl status mysql.service

journalctl -xe journalctl -xe

enter image description here

enter image description here

Mysql status: enter image description here

3
  • Your problem has nothing to do with SSH. The solution is to work out why MySQL is not starting. You should post your logs/error outputs to determine why.
    – davidgo
    Commented Jun 26, 2020 at 7:32
  • I added the error log in /var/log/mysql/error.log Thanks
    – PC Welcome
    Commented Jun 26, 2020 at 13:58
  • added also results for systemctl status mysql.service and journalctl -xe
    – PC Welcome
    Commented Jun 26, 2020 at 16:27

1 Answer 1

0

Finally, the solution was to go to: etc/mysql/mysql.conf.d/mysqld.cnf I found mysqld.cnf permission set to 644 I change it to 777 and the MySQL works again. I don't know why running the upgrade with this command sudo apt-get upgrade openssh-server changed many permissions to files and directories.

I think that 777 is too open, can I make a less permission without stoping MySQL? what permission do you advise me to both mysqld.cnf and my.cnf in those directories? etc/mysql/mysql.conf.d/mysqld.cnf and etc/mysql/my.cnf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .