Techolac - Computer Technology News
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games
No Result
View All Result
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games
No Result
View All Result
Techolac - Computer Technology News
No Result
View All Result
Home Linux

OpenBSD install MariaDB database server

by Editorial Staff
July 1, 2019
in Linux
Reading Time: 4 mins read

How do I install MariaDB database servers on OpenBSD Unix operating systems?

Introduction: MariaDB is a drop in replacement for Oracle MySQL servers. MariaDB is a multithreaded SQL database with a command syntax very similar to mSQL. This page shows how to install MariaDB server on OpenBSD. There are two packages of MariaDB on OpenBSD 6.4

 

Table of Contents
Adblock detected 😱
How to search for MariaDB packages
OpenBSD install MariaDB database server using pkg_add
How to install MariaDB client on OpenBSD
How to enable and start MariaDB server at boot time on OpenBSD
Enable MariaDB
Initialize MariaDB data directory
Start MariaDB service on OpenBSD
Stop MariaDB service on OpenBSD
Restart MariaDB service on OpenBSD
Check MariaDB service status on OpenBSD
Verify that MariDB service running and port is open
How to secure MariaDB installation
How to test MariaDB installation
How to configure MariaDB on OpenBSD 6.4
How to open MariaDB port using PF firewall on OpenBSD
Conclusion
Adblock detected 😱
My website is made possible by displaying online advertisements to my visitors. I get it! Ads are annoying but they help keep this website running. It is hard to keep the site running and producing new content when so many people block ads. Please consider donating money to the nixCraft via PayPal/Bitcoin, or become a supporter using Patreon.

 

  1. mariadb-server – The MariaDB server.
  2. mariadb-client – The client side of MariaDB server including mysqlclient library and headers for the MariaDB client API.

How to search for MariaDB packages

Run the following pkg_info command along with grep command:
pkg_info -Q mariadb
Search for PHP client that can access mariadb server:
pkg_info -Q mariadb | grep php
How to search for MariaDB packages on OpenBSD

OpenBSD install MariaDB database server using pkg_add

Type the following pkg_add command to install MariaDB on OpenBSD 6.4:
# pkg_add -v mariadb-server
OR
$ doas pkg_add -v mariadb-server
OpenBSD install MariaDB database using pkg_add command

How to install MariaDB client on OpenBSD

Simply run:
# pkg_add -v mariadb-client
OR
$ doas pkg_add -v mariadb-client

How to enable and start MariaDB server at boot time on OpenBSD

To configure and control daemons and services on OpenBSD use rcctl command

Enable MariaDB

# rcctl enable mysqld
OR
$ doas rcctl enable mysqld

Initialize MariaDB data directory

You need to run mysql_install_db command. It initializes the MariaDB data directory and creates the system tables:
# mysql_install_db

Configure MariaDB on OpenBSD 6.x

Start MariaDB service on OpenBSD

# rcctl start mysqld

Stop MariaDB service on OpenBSD

# rcctl stop mysqld

Restart MariaDB service on OpenBSD

# rcctl restart mysqld

Check MariaDB service status on OpenBSD

# rcctl check mysqld
How to Start OR Stop MariaDB server manually on OpenBSD

Verify that MariDB service running and port is open

Run pgrep command to searche the process named mysqld:
# pgrep mysqld
Another option is to run ps command:
# ps aux | grep mysqld
Verify that TCP port 3306 is open using netstat command:
# netstat -f inet -na
# netstat -f inet -na | grep 3306

How to insall MariaDB on OpenBSD and verify it

How to secure MariaDB installation

Run the following script:
# mysql_secure_installation

How to secure the MariaDB installation on OpenBSD
Securing MariaDB server installations to avoid compromising server

How to test MariaDB installation

Run the following mysql command:
mysql -u root -p
How to test mariadb installation

How to configure MariaDB on OpenBSD 6.4

Edit /etc/my.cnf file:
# vi /etc/my.cnf
For example, change IP address binding from localhost:
bind-address = 127.0.0.1
To LAN IP address 192.168.2.200:
bind-address = 192.168.2.200
Save and close the file. Restart mysqld service on OpenBSD:
# rcctl restart mysqld

How to open MariaDB port using PF firewall on OpenBSD

Simply add the following rule to /etc/pf.conf

pass in proto tcp from 192.168.2.0/24 to any port 3306 keep state

Test it and reload the rules:
# pfctl -v -nf /etc/pf.conf
# pfctl -v -f /etc/pf.conf

Conclusion

You learned how to set up and install MariaDB on OpenBSD. For more information see the official MariaDB site here and pkg_add page here.

 

Related Posts

Apache, MySQL Performance

How to Optimize Apache, MySQL Performance for 1GB RAM VPS Centos/RHEL

April 7, 2024
Top 5 MySQL Performance Tuning Tips

Top 5 MySQL Performance Tuning Tips

January 25, 2023

Top Commands to Check the Running Processes in Linux

May 27, 2022

4 Tips to Prevent and Troubleshoot the ImagePullBackOff Kubernetes Error

March 30, 2022

How Common Signals are Used in Kubernetes Pod Management

November 20, 2021

How to Transfer Windows 10 to SSD?

April 14, 2022

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Articles

  • BigCharts Stock Charting and Screening Alternatives
  • Veo Camera Alternatives Recording and Analysing Sports Matches
  • Best 10 WizTree Alternatives for Disk Space Analyzer
  • Liner AI: The AI Search Engine and Alternatives
  • Webcam Toy: Complete Guide to Features & Alternatives
  • Google Vids Competitors For Online Video Creator Editor
  • 8 Best Free GameCube Emulators in 2025

Related Posts

None found

  • DashTech
  • TechDaddy
  • Terms and Conditions
  • Disclaimer
  • Write for us

© Techolac © Copyright 2019 - 2022, All Rights Reserved.

No Result
View All Result
  • Home
  • Internet
  • Business
  • Computers
  • Gadgets
  • Lifestyle
  • Phones
  • Travel
  • Tech
  • More
    • Automotive
    • Education
    • Entertainment
    • Health
    • SEO
    • Linux
    • WordPress
    • Home Improvement
    • How to
    • Games

© Techolac © Copyright 2019 - 2022, All Rights Reserved.