MYSQL won't start after a reboot

D.O. 1xCPU - 2 GB Memory / 25 GB Disk
|OS type and version:| Ubuntu Linux 18.04.6|
|Webmin version:| 1.984 |
MySQL Version: '5.7.36
All working autonomously for months.
|||
Tonight I upgraded to the above webmin version. I restarted the server and noticed that 100%CPU was going on for a long time. I decided to disable Clamd and do another reboot. I worked on an opencart store for about an hour, but it was obvious that something was still wrong. So I did another reboot and this time, MySQL did not start at all.

The full MySQL error message was : DBI connect failed : Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

I tried a restart a dozen times in the last 3 hours. Meantime was checking your site and Google for answers. I found out that the folder and socket were missing. After another reboot just now (06:30am), and having not started automatically, I tried starting it again manually and mySQL started (for no apparent reason)!

This never happened to me ever before tonight. I do not know if it is connected to the webmin update -
I have not made any other changes today apart from that.

As I am writing this, CPU is 100% for the past 35 minutes. I will leave it as is for now.
What action should I take?

UPDATE 24/01/22 16:35:
The server is still @ 100% CPU. So I decided to see what is hogging the system.
I stopped mySQL and CPU dropped to 20%~30% range (mostly apache processes in htop).
I stopped apache and CPU dropped to 0%~2% range.
I started mySQL and CPU STAYED at 0%~2% range.
I started apache and CPU went to 100% immediately.
Even so, MySQL responds to my Workbench remote queries just fine.
Apache access log is empty.
Error log:
[Mon Jan 24 16:51:11.338237 2022] [suexec:notice] [pid 23715] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Jan 24 16:51:11.370416 2022] [so:warn] [pid 23715] AH01574: module headers_module is already loaded, skipping
[Mon Jan 24 16:51:11.702626 2022] [mpm_prefork:notice] [pid 23729] AH00163: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1j configured – resuming normal operations
[Mon Jan 24 16:51:11.702675 2022] [core:notice] [pid 23729] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Jan 24 16:51:30.904094 2022] [mpm_prefork:error] [pid 23729] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

This seems to be an Apache issue?

One problem per topic please.

The socket would be missing if it’s not running. Starting MySQL should create the socket, it shouldn’t be there when MySQL is not running.

I assume the mysql service is enabled? That determines whether systemd will start it on boot. Check it with systemctl status mysql (I think mysql is the service name on Ubuntu, but you should confirm that.)

● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-01-24 16:41:45 EET; 2h 16min ago
Process: 20147 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
Process: 20126 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 20149 (mysqld)
Tasks: 128 (limit: 2314)
CGroup: /system.slice/mysql.service
└─20149 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid

Please check out my update in initial post

Open new topics for new problems. If it’s an Apache problem, your title makes no sense and most of your post is irrelevant, so I have no idea what’s going on. If MySQL is fine, mark this topic solved and start a new one with details of the Apache problem.

I do not know what the problem is yet.
All I know is that it all started after a regular update to Webmin/Virtualmin.
Then all hell broke loose. This is my cpu usage last 7 days.


and last 24 hours

Can I just revert back to the old version of Webmin and see if it makes a difference?

What is creating those loads? What is the output of top command?

Hi Ilia,

top - 21:53:38 up 2:51, 2 users, load average: 103.14, 69.11, 31.22
Tasks: 388 total, 110 running, 241 sleeping, 0 stopped, 0 zombie
%Cpu(s): 25.9 us, 71.5 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 2.6 si, 0.0 st
KiB Mem : 2040972 total, 71336 free, 1871728 used, 97908 buff/cache
KiB Swap: 3906244 total, 1575232 free, 2331012 used. 24904 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
34 root 20 0 0 0 0 R 20.1 0.0 6:48.61 kswapd0
1815 mysql 20 0 1392132 23332 2028 S 11.8 1.1 1:42.07 mysqld
13011 mysite 20 0 522728 16008 3064 R 1.0 0.8 0:01.91 php-cgi7.2
13012 mysite 20 0 522728 17800 3040 R 1.0 0.9 0:01.91 php-cgi7.2
13017 mysite 20 0 522728 16020 2892 R 1.0 0.8 0:01.88 php-cgi7.2
13161 mysite 20 0 522728 19496 3104 R 1.0 1.0 0:01.79 php-cgi7.2
13174 mysite 20 0 522728 18480 3152 R 1.0 0.9 0:01.77 php-cgi7.2
13191 mysite 20 0 520680 18696 3796 R 1.0 0.9 0:01.71 php-cgi7.2
13199 mysite 20 0 520680 21112 4692 R 1.0 1.0 0:01.66 php-cgi7.2
13252 mysite 20 0 520680 23696 4772 R 1.0 1.2 0:01.58 php-cgi7.2
13267 mysite 20 0 520680 22100 4556 R 1.0 1.1 0:01.55 php-cgi7.2
13296 mysite 20 0 520680 22216 5404 R 1.0 1.1 0:01.38 php-cgi7.2
12964 mysite 20 0 522728 18212 3232 R 0.7 0.9 0:02.54 php-cgi7.2
12975 mysite 20 0 522728 16304 3088 R 0.7 0.8 0:02.15 php-cgi7.2
12983 www-data 20 0 199324 5784 3688 R 0.7 0.3 0:00.22 apache2
12986 mysite 20 0 522728 17336 3832 R 0.7 0.8 0:02.00 php-cgi7.2
12987 mysite 20 0 522728 17256 3056 R 0.7 0.8 0:01.99 php-cgi7.2
13008 mysite 20 0 522728 17712 3128 R 0.7 0.9 0:01.91 php-cgi7.2
13038 mysite 20 0 522728 17404 2920 R 0.7 0.9 0:01.87 php-cgi7.2
13039 mysite 20 0 522728 14404 4728 R 0.7 0.7 0:01.92 php-cgi7.2
13040 www-data 20 0 199312 6816 4504 R 0.7 0.3 0:00.17 apache2
13055 www-data 20 0 199300 5792 3692 R 0.7 0.3 0:00.09 apache2
13057 mysite 20 0 522728 17900 2892 R 0.7 0.9 0:01.85 php-cgi7.2
13064 www-data 20 0 199312 6848 4532 S 0.7 0.3 0:00.12 apache2
13073 www-data 20 0 199312 5504 3612 R 0.7 0.3 0:00.19 apache2
13085 mysite 20 0 520680 18408 3436 R 0.7 0.9 0:01.84 php-cgi7.2
13089 www-data 20 0 199312 6604 4456 S 0.7 0.3 0:00.15 apache2
13097 mysite 20 0 520680 18156 4732 R 0.7 0.9 0:01.86 php-cgi7.2
13112 mysite 20 0 522728 17644 2876 R 0.7 0.9 0:01.77 php-cgi7.2
13125 mysite 20 0 522728 15500 2828 R 0.7 0.8 0:01.77 php-cgi7.2
13134 mysite 20 0 522728 18368 3028 R 0.7 0.9 0:01.80 php-cgi7.2
13145 mysite 20 0 522728 17188 3140 R 0.7 0.8 0:01.77 php-cgi7.2
13158 mysite 20 0 522728 17592 2896 R 0.7 0.9 0:01.77 php-cgi7.2
13164 mysite 20 0 522728 18472 3104 R 0.7 0.9 0:01.77 php-cgi7.2
13168 mysite 20 0 520680 17280 3840 R 0.7 0.8 0:01.74 php-cgi7.2
13170 mysite 20 0 520680 16180 3108 R 0.7 0.8 0:01.77 php-cgi7.2
13172 mysite 20 0 522728 18584 3028 R 0.7 0.9 0:01.80 php-cgi7.2
13178 mysite 20 0 522728 16068 2892 R 0.7 0.8 0:01.77 php-cgi7.2
13180 mysite 20 0 522728 18996 3072 R 0.7 0.9 0:01.75 php-cgi7.2
13183 mysite 20 0 522728 19560 3092 R 0.7 1.0 0:01.75 php-cgi7.2
13189 mysite 20 0 522728 18956 3084 R 0.7 0.9 0:01.69 php-cgi7.2
13195 mysite 20 0 522728 19668 3108 R 0.7 1.0 0:01.73 php-cgi7.2

Please open a new topic for new problems. This is not a conversation about MySQL not starting.