Mysql could not be started no matter what i do

Keywords: WordPress - Google Cloud Platform - Technical issue - Services (Apache, MariaDB, MySQL…)

bnsupport ID: 300d13c7-9735-43ed-f1a6-463adf19edc9

bndiagnostic output:

? Resources: Found possible issues
? Processes: Found possible issues
? Mysql: Found possible issues
? Apache: Found possible issues
? Connectivity: Found possible issues
https://docs.bitnami.com/general/how-to/troubleshoot-permission-issues/
https://docs.bitnami.com/general/apps/wordpress/administration/use-pagespeed/#disable-pagespeed
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/general/faq/administration/use-firewall/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
Greetings,

I hard restart my VM on GCP and then mysql cant be started.
I tried the script and everything on this community but no luck.

the diagnostic tool id is 300d13c7-9735-43ed-f1a6-463adf19edc9

something to consider…
i know my VM has a small space this is not an issue
i run my blog and apache on a different port than 80 and 443 so this is not an issue
my VM has a little ram and this is not an issue.

I’m thinking reinstall MySQL ,but i do not want to lose my data

Hi @gooogle1414,

It seems to be due to a lack of space:

[Sun Oct 10 14:57:42.351909 2021] [pagespeed:error] [pid 2453:tid 140625710712576] [mod_pagespeed 1.13.35.2-0 @2453] /opt/bitnami/apache2/logs/pagespeed_log/stats_log_global: flushing file 28(No space left on device) 

I recommend increasing the disk storage:

https://docs.bitnami.com/google/faq/administration/resize-server-disk/

Regards,
Michiel

no sir @michiel it’s not the space, i have more than 1GB free which is enough for my small private blog.

and the error you paste is related to apache, yes I unpacked a huge log tar file that cause this (No space left on device) issue.

as I said on the problem is with MySQL that is not startable anymore

can someone please guide me through how to reinstall mysql without losing data?

Hi @gooogle1414,

Your instance is using swap memory, which indicates it’s running low on available memory. In any case, your mysql.log file seems empty, can you check for errors in any recently rotated log files in the " /opt/bitnami/mariadb/data/" folder?

Can you tell me the output of the following command?

sudo gonit status mariadb

Regards,
Michiel

there is only mysql-log*gz file in /opt/bitnami/mysql/data/ and it’s empty !
the output of gonit status mariadb is

Uptime                         82h40m0s
Last Check                     2021-10-14 09:00:59.426911001 +0000 UTC m=+297600.653420983
Next Check                     2021-10-14 09:02:59.426911001 +0000 UTC m=+297720.653420983
Pid                            2782
Pid File                       /var/run/gonit.pid
Control File                   /etc/gonit/gonitrc
Socket File                    /var/run/gonit.sock
Log File                       /var/log/gonit.log

the output of gonit status mysql is

Uptime 82h39m44s
Last Check 2021-10-14 08:58:59.455324043 +0000 UTC m=+297480.681834025
Next Check 2021-10-14 09:00:59.455324043 +0000 UTC m=+297600.681834025
Pid 2782
Pid File /var/run/gonit.pid
Control File /etc/gonit/gonitrc
Socket File /var/run/gonit.sock
Log File /var/log/gonit.log
Process ‘mysql’
monitoring status Not monitored

ram is 75% utlized

what i meant by empty is the gz file which is date 10 October 2021, the directory (data) has many files

Hi @gooogle1414,

Could you try running mariadb manually using the following command and tell me the output?

sudo -u mysql /opt/bitnami/mariadb/sbin/mysqld --defaults-file=/opt/bitnami/mariadb/conf/my.cnf --basedir=/opt/bitnami/mariadb --datadir=/bitnami/mariadb/data --socket=/opt/bitnami/mariadb/tmp/mysql.sock --pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid

Regards,
Michiel

i changed from mariadb to mysql
sudo: /opt/bitnami/mysql/sbin/mysqld: command not found

however both are
sudo: /opt/bitnami/mariadb/sbin/mysqld: command not found

so I changed from sbin to bin , and it executed and output this

Killed

to cover some cases I add an additional 1 GB ram now the free ram is more than 1 GB free

and the storage space is more than 1.2 GB free

but still MySQL cant be started

@michiel thanks for your helping.

problem is solved :slight_smile:

what happend?

actually it’s the ram usage that cuases the mysql not starting, it needs enough ram depending on the data , i’d say at least 0.3 GB.

when the propbelm happend first time I tried to debug and during this debugging i changhed the onwership of /mysql/data so i can read log.

then i forgot to return the ownership of the dir.

i turned off some serviec at the time to see if mysql would run, but it was screaming that it has no premisson beside not enough ram.

when i executed ls -la i saw the premisson and immedtaly know the problem

thanks again :slight_smile:

Hi @gooogle1414,

I’m glad to hear that. We are working on the bndiagnostic tool to improve the error detection in that case.

Regards,
Michiel