Koozali.org: home of the SME Server

After power outage the SQL service seems to be down.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: After power outage the SQL service seems to be down.
« Reply #15 on: July 06, 2022, 01:11:38 PM »
Ah it's two separate lines.

Slightly confusing (evidently!!)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline JunkmanNZ

  • 10
  • +0/-0
Re: After power outage the SQL service seems to be down.
« Reply #16 on: July 07, 2022, 03:10:15 AM »
Each time I do
Code: [Select]
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tablesI seem to drop out of the command prompt system and the server seems to be waiting for me to enter something, as soon as I enter any line it goes and does some thinking, then drops me back to command prompt.

I've been trying to do the steps in https://wiki.koozali.org/MySQL#MariaDB.2FMySQL_fails_to_start and getting confused with the loss of the command prompt.

Any hints?

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: After power outage the SQL service seems to be down.
« Reply #17 on: July 07, 2022, 04:03:40 AM »
you need to type other commands in another terminal. 

Offline JunkmanNZ

  • 10
  • +0/-0
Re: After power outage the SQL service seems to be down.
« Reply #18 on: July 07, 2022, 04:26:21 AM »
you need to type other commands in another terminal.

Tried that, whatever I try returns the message:
Quote
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
WebSearching talked about editing the my.cnf, which I did, but to me it all looks like it should be. Plus it has a comment at the top saying "!!DO NOT MODIFY THIS FILE!!"
 
Do I need to reset the sock somehow? Or is there something else I should be looking at?

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: After power outage the SQL service seems to be down.
« Reply #19 on: July 07, 2022, 01:50:38 PM »
have you checked at the log file when trying to start the service ?

there are high chances it fails because of the remaining sock file or something similar.

Offline JunkmanNZ

  • 10
  • +0/-0
Re: After power outage the SQL service seems to be down.
« Reply #20 on: July 08, 2022, 04:55:24 AM »
have you checked at the log file when trying to start the service ?

there are high chances it fails because of the remaining sock file or something similar.

I've had a look at a few log files, but I've not been able to locate anything that seems helpful, it might be that I am looking at the wrong logs.

Is there a way to reset all the sock files?

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: After power outage the SQL service seems to be down.
« Reply #21 on: July 08, 2022, 05:47:39 AM »
I've had a look at a few log files, but I've not been able to locate anything that seems helpful, it might be that I am looking at the wrong logs.

Is there a way to reset all the sock files?

just rewrote the command should do the job now
Code: [Select]
systemctl stop mariadb.service
/usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql  --user=mysql --skip-grant-tables


then you should be able to do the final steps (considering your table dump is in a file called  /home/e-smith/db/mysql/mysql.user.dump)
Code: [Select]
mysql mysql < /home/e-smith/db/mysql/mysql.user.dump
expand-template /var/service/mysqld/set.password
mysql mysql < /var/service/mysqld/set.password
mysqladmin shutdown
systemctl start mariadb



in any case when a daemon in charge of a socket has crashed and the socket is still there, check it is not running anymore and you can delete it, see :
https://www.ibm.com/support/pages/mysql-does-not-start-after-power-outage
« Last Edit: July 08, 2022, 05:50:17 AM by Jean-Philippe Pialasse »

Offline JunkmanNZ

  • 10
  • +0/-0
Re: After power outage the SQL service seems to be down.
« Reply #22 on: July 09, 2022, 04:23:09 AM »
Thanks Jean-Philippe,

That seems to have fixed the issue, I had another power cut last night (must get the battery replaced in the UPS) and everything seems to be up and running again.


Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: After power outage the SQL service seems to be down.
« Reply #23 on: July 09, 2022, 06:18:44 AM »
happy to read that. 

thank for the feed back. 

yes for the battery !