Linux Tutorials

OpenBSD set up MariaDB database server

How do I set up MariaDB database servers on OpenBSD Unix working techniques?

Introduction: MariaDB is a drop in substitute for Oracle MySQL servers. MariaDB is a multithreaded SQL database with a command syntax similar to mSQL. This web page exhibits how to put in MariaDB server on OpenBSD. There are two packages of MariaDB on OpenBSD 6.four mariadb-server – The MariaDB server.mariadb-client – The consumer aspect of MariaDB server together with mysqlclient library and headers for the MariaDB consumer API.

Learn how to seek for MariaDB packages

Run the next pkg_info command together with grep command:
pkg_info -Q mariadb
Seek for PHP consumer that may entry mariadb server:
pkg_info -Q mariadb | grep php
How to search for MariaDB packages on OpenBSD

OpenBSD set up MariaDB database server utilizing pkg_add

Kind the next pkg_add command to put in MariaDB on OpenBSD 6.four:
# pkg_add -v mariadb-server
OR
$ doas pkg_add -v mariadb-server
OpenBSD install MariaDB database using pkg_add command

Learn how to set up MariaDB consumer on OpenBSD

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

Learn how to allow and begin MariaDB server at boot time on OpenBSD

To configure and management daemons and providers on OpenBSD use rcctl command

Allow MariaDB

# rcctl allow mysqld
OR
$ doas rcctl allow mysqld

Initialize MariaDB information listing

You might want to run mysql_install_db command. It initializes the MariaDB information listing and creates the system tables:
# mysql_install_db
Configure MariaDB on OpenBSD 6.x

Begin MariaDB service on OpenBSD

# rcctl begin mysqld

Cease MariaDB service on OpenBSD

# rcctl cease mysqld

Restart MariaDB service on OpenBSD

# rcctl restart mysqld

Test MariaDB service standing on OpenBSD

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

Confirm that MariDB service working and port is open

Run pgrep command to searche the method named mysqld:
# pgrep mysqld
An alternative choice is to run ps command:
# ps aux | grep mysqld
Confirm that TCP port 3306 is open utilizing netstat command:
# netstat -f inet -na
# netstat -f inet -na | grep 3306
How to insall MariaDB on OpenBSD and verify it

Learn how to safe MariaDB set up

Run the next script:
# mysql_secure_installation
How to secure the MariaDB installation on OpenBSDSecuring MariaDB server installations to keep away from compromising server

Learn how to take a look at MariaDB set up

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

Learn how to configure MariaDB on OpenBSD 6.four

Edit /and so on/my.cnf file:
# vi /and so on/my.cnf
For instance, change IP deal with binding from localhost:
bind-address = 127.zero.zero.1
To LAN IP deal with 192.168.2.200:
bind-address = 192.168.2.200
Save and shut the file. Restart mysqld service on OpenBSD:
# rcctl restart mysqld

Learn how to open MariaDB port utilizing PF firewall on OpenBSD

Merely add the next rule to /and so on/pf.conf

move in proto tcp from 192.168.2.zero/24 to any port 3306 preserve state

Check it and reload the principles:
# pfctl -v -nf /and so on/pf.conf
# pfctl -v -f /and so on/pf.conf

Conclusion

You realized learn how to arrange and set up MariaDB on OpenBSD. For extra info see the official MariaDB web site right here and pkg_add web page right here.

Posted by: Vivek Gite

The writer is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a coach for the Linux working system/Unix shell scripting. Get the newest tutorials on SysAdmin, Linux/Unix and open supply subjects by way of RSS/XML feed or weekly electronic mail publication.

Source link

Related Articles

Back to top button