MariaDB - I cannot stop the service  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
wellsey
Posts: 47
Joined: Sun Jun 03, 2018 3:56 pm

Re: MariaDB - I cannot stop the service

#11 Post by wellsey »

timkb4cq wrote: Sat Nov 09, 2024 3:55 pm Have you tried using kill instead of pkill? pkill sends a message to the process. kill -9 just terminates it.
Thanks for that, tried it 'kill' does live up to its name, 'pkill' did not
"There's no limit to what he can do. He could destroy the Earth... If anything should happen to me you must go to Gort, you must say these words, 'Klaatu barada nikto', please repeat that."

Dell Latitude E4310 I5 8GB 256GB SSD

User avatar
wellsey
Posts: 47
Joined: Sun Jun 03, 2018 3:56 pm

Re: MariaDB - I cannot stop the service

#12 Post by wellsey »

aika wrote: Sat Nov 09, 2024 1:32 pm
Was MariaDB started correctly under SysVinit? I would start the MX system as SystemD and test whether MariaDB then behaves correctly:

Code: Select all

sudo systemctl stop mariadb
MariaDB with SysVinit => https://mariadb.com/kb/en/sysvinit/#int ... er-process
MariaDB with SystemD => https://mariadb.com/kb/en/systemd/#inte ... er-process
Good idea to try SystemD - and it works correctly in SystemD ie the systemctl command will start/stop/restart ( even status command produces information but not complete info as a DB password is not given )

So maybe the conclusion is the install from MXPI under SysVinit was not properly done?
"There's no limit to what he can do. He could destroy the Earth... If anything should happen to me you must go to Gort, you must say these words, 'Klaatu barada nikto', please repeat that."

Dell Latitude E4310 I5 8GB 256GB SSD

User avatar
wellsey
Posts: 47
Joined: Sun Jun 03, 2018 3:56 pm

Re: MariaDB - I cannot stop the service  [Solved]

#13 Post by wellsey »

CharlesV wrote: Sat Nov 09, 2024 11:24 am What version of mariadb is loaded?

Have you tried directly shutting it down with the mariadb-admin command?
https://mariadb.com/kb/en/mariadb-admin/
https://mariadb.com/kb/en/shutdown/

In my installs I have to use mongod or mysql to shut the service down, and have only ever used those.
I used Popular packages under the Server tab of MXPI and it iinstalled mariadb 10.11

Thank YOU , Your suggestion of

Code: Select all

 mariadb-admin shutdown
WORKED and because the command allows the use of a password

Code: Select all

  sudo mariadb-admin -pmypassword status
Uptime: 867  Threads: 1  Questions: 2  Slow queries: 0  Opens: 17  Open tables: 10  Queries per second avg: 0.002
also worked

( command mysqladmin worked just the same BTW)

I can understand the need for a special command to cope with the controlled shutting down of replication to slaves, but in my situation of not using replication I would have thought that a simple stop of the service should work in SysVinit just as it did under SystemD

Any way this seems to have solved it I will mark it so - Thanks to all who posted
"There's no limit to what he can do. He could destroy the Earth... If anything should happen to me you must go to Gort, you must say these words, 'Klaatu barada nikto', please repeat that."

Dell Latitude E4310 I5 8GB 256GB SSD

User avatar
CharlesV
Global Moderator
Posts: 7078
Joined: Sun Jul 07, 2019 5:11 pm

Re: MariaDB - I cannot stop the service

#14 Post by CharlesV »

Excellent! Glad you have it resolved.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
fehlix
Developer
Posts: 12613
Joined: Wed Apr 11, 2018 5:09 pm

Re: MariaDB - I cannot stop the service

#15 Post by fehlix »

wellsey wrote: Sun Nov 10, 2024 11:24 am So maybe the conclusion is the install from MXPI under SysVinit was not properly done?
Not sure, installed with running sysvinit, and testing start,stop status:
Status:

Code: Select all

sudo service mariadb status
/usr/bin/mariadb-admin  Ver 9.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version      10.11.6-MariaDB-0+deb12u1
Protocol version    10
Connection      Localhost via UNIX socket
UNIX socket     /run/mysqld/mysqld.sock
Uptime:         11 sec

Threads: 1  Questions: 61  Slow queries: 0  Opens: 33  Open tables: 26  Queries per second avg: 5.545.
Stop:

Code: Select all

sudo service mariadb stop
Stopping MariaDB database server: mariadbd.
Status:

Code: Select all

sudo service mariadb status
MariaDB is stopped..
Start:

Code: Select all

sudo service mariadb start
Starting MariaDB database server: mariadbd.
Status again:

Code: Select all

sudo service mariadb status
/usr/bin/mariadb-admin  Ver 9.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version      10.11.6-MariaDB-0+deb12u1
Protocol version    10
Connection      Localhost via UNIX socket
UNIX socket     /run/mysqld/mysqld.sock
Uptime:         7 sec

Threads: 1  Questions: 61  Slow queries: 0  Opens: 33  Open tables: 26  Queries per second avg: 8.714.
Works all as it should be.

User avatar
CharlesV
Global Moderator
Posts: 7078
Joined: Sun Jul 07, 2019 5:11 pm

Re: MariaDB - I cannot stop the service

#16 Post by CharlesV »

From what I read in the mariadb KB, some applications using the DB will lock a table or record and then the ONLY method of shutting the DB down is with either the kill command or that admin shutdown.

I have not seen any of these in my installs, but I am primarily using Unifi Controllers or very simple DB apps.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
fehlix
Developer
Posts: 12613
Joined: Wed Apr 11, 2018 5:09 pm

Re: MariaDB - I cannot stop the service

#17 Post by fehlix »

CharlesV wrote: Sun Nov 10, 2024 12:30 pm From what I read in the mariadb KB, some applications using the DB will lock a table or record and then the ONLY method of shutting the DB down is with either the kill command or that admin shutdown.

I have not seen any of these in my installs, but I am primarily using Unifi Controllers or very simple DB apps.
Yes, that's correct, and that's init-script and systemd service to stop are doing:

Code: Select all

sudo service mariadb stop
is doing
look here into the init scrpt:

Code: Select all

grep shutdown /etc/init.d/mariadb 
    shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
      [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"

User avatar
CharlesV
Global Moderator
Posts: 7078
Joined: Sun Jul 07, 2019 5:11 pm

Re: MariaDB - I cannot stop the service

#18 Post by CharlesV »

it would seem so.. but it appears something is a little different between the two.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

Post Reply

Return to “MX Help”