0

I have a DigitalOcean Ubuntu 16.4 machine with Nginx installed. Maybe it's related to Wordpress installation, maybe not. MySQL shuts itself down randomly.

It has a 1GB swap file created. 1GB RAM. Might not be related to memory issue.

Started to happen when I did an apt-get upgrade and the upgrade stopped while MySQL was upgrading.

No error log at all.

But here is the log from Ubuntu-

(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 
10%^M(Reading database ... 
15%^M(Reading database ... 20%^M(R$
Removing linux-headers-4.4.0-168 (4.4.0-168.197) ...
Setting up mysql-server-5.7 (5.7.28-0ubuntu0.16.04.2) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql- 
common/configure-symlinks: 
No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup 
error from a previous 
failure.
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server

I found a fix way back by commenting out a line in the MySQL configuration file but forgot which one. That fixed it when same problem encountered. Memory allocation looks fine as far as I am concerned but then again, I am never logged in or monitoring the process when it's shutting down.

kenlukas
  • 2,886
  • 2
  • 14
  • 25
RP McMurphy
  • 101
  • 2
  • What's the result when invoke: `dpkg -l | grep -i mysql`? – NeilWang Dec 08 '19 at 21:49
  • @NeilWang https://imgur.com/JUHCAEY I actually had PHP 7.0 installed and then upgraded to 7.2. Did I need to do anything to hook mysql up with new PHP installation? The issue started to happen after I ran a command to upgrade Ubuntu with apt-get upgrade and got stuck with mysql on the error shown in the question. – RP McMurphy Dec 08 '19 at 21:58
  • there is nothing related with PHP and MySQL. The reason I would like you to check the dpkg package is the strange error on your log:"mysql-server depends on mysql-server-5.7". I think your MySQL package is either duplicated or broken. – NeilWang Dec 08 '19 at 22:12
  • Looks to me like an installation issue as well. Export the database, remove MySQL completely, reinstall, import data. I'm not a DB expert though. – Tim Dec 08 '19 at 22:45
  • What messages in MySQL log files? – Rick James Dec 09 '19 at 01:44
  • @RickJames once I restart mysql, it logs the usual startup logs but nothing else whenever it shuts itself down, just empty after the initial logs. – RP McMurphy Dec 19 '19 at 15:50
  • @NeilWang The duplication might be the case btw. When I tried to update and upgrade Ubuntu, it did the upgrades and informed in a dialogue that the version of MySQL changed and if I would like to keep the current one or add the new one. I selected the keep as is one though, the local copy. Maybe then the duplication happened? Which should not be the case though as I selected to leave as is. – RP McMurphy Dec 19 '19 at 15:54
  • Was `mysql_upgrade` run? – Rick James Dec 19 '19 at 17:27
  • @RickJames no. That's where the upgrade stopped. And the issue began. – RP McMurphy Dec 19 '19 at 17:32
  • Let's focus on what the script `mysql_upgrade` was doing when it stopped. Note: I am asking about that script, not the entire apt get. – Rick James Dec 19 '19 at 17:34
  • @RickJames When I run mysql_upgrade, it runs and shows ok to everything and runs successfully. FYI: apt get stops upgrading at mysql with the error specified on the image attached with the question. – RP McMurphy Dec 19 '19 at 17:51
  • I think the mysql packages are already inconsistent. The version asked you to keep or not should be the my.cnf configuration file. I think you should took Tim's advice: backup data, purge mysql, install mysql and restore data. – NeilWang Dec 20 '19 at 01:26
  • @NeilWang Ok. I'll do that. Will it affect the PHP or Nginx installation in any way? Just to be safe. – RP McMurphy Dec 20 '19 at 13:32
  • @RPMcMurphy No, it definitely won't affect other installations – NeilWang Dec 22 '19 at 05:44

0 Answers0