MariaDB – Admin – managing and confirming service is running

Desired Outcome:
Understanding the components that go into running the MariaDB Server – service, confirming status, starting, stopping, scripts, etc. Based on various documentation I’ve referred to, it’s important to now understand the end-to-end flow of database service startup.

Q: What is the MariaDB server binary called?
A: mysqld
Note: The “d” stands for daemon, and is written “mysqld” to preserve upstream compatibility with MySQL

Q: Is MariaDB a binary drop-in replacement for SQL?
A: Yes

Q: How to check if mysqld is running? (Option 1)
A: sudo service mysqld status
Redirecting to /bin/systemctl status mysqld.service
mariadb.service – MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
ââmigrated-from-my.cnf-settings.conf
Active: active (running) since Wed 2015-11-25 10:34:27 PST; 4 days ago
Main PID: 1291 (mysqld)
Status: “Taking your SQL requests now…”
CGroup: /system.slice/mariadb.service
ââ1291 /usr/sbin/mysqld
Nov 25 10:34:26 localhost.localdomain mysqld[1291]: 2015-11-25 10:34:26 13972…
Nov 25 10:34:27 localhost.localdomain mysqld[1291]: Version: ‘10.1.8-MariaDB’…
Nov 25 10:34:27 localhost.localdomain systemd[1]: Started MariaDB database se…
Hint: Some lines were ellipsized, use -l to show in full.

Q: How to check if mysqld is running? (Option 2)
A: systemctl status mysqld.service
mariadb.service – MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
ââmigrated-from-my.cnf-settings.conf
Active: active (running) since Wed 2015-11-25 10:34:27 PST; 6 days ago
Main PID: 1291 (mysqld)
Status: “Taking your SQL requests now…”
CGroup: /system.slice/mariadb.service
ââ1291 /usr/sbin/mysqld

Q: How to check if MariaDB.service is running?
A: systemctl is-active mariadb.service
Note: Will respond “active” if it is running

Q: How do you manually start the SQL Server?
A: sudo systemctl start mariadb.service

Q: How do you manually stop the SQL Server?
A: sudo systemctl stop mariadb.service

Q: How do you launch the SQL Monitor?
A: mysql -u root -p

Q: How do startup scripts work (current configuration) to auto-load MariaDB upon server statup?
A: Script is within: /etc/init.d/mysql
Note: XREF to this for more documentation — https://mariadb.com/kb/en/mariadb/mysqlserver/
Note: When I had installed, it automatically created the script within /etc/init.d and called it mysql

About Paul

CERT Coordinator, Ham Radio Operator, GTD Fan; Photographer; Domino/Notes Administrator
This entry was posted in Linux. Bookmark the permalink.