On Sat, Aug 24, 2024 at 07:21:57PM -0400, David Colburn wrote:
> I found these instructions to install MariaDB Servers in OpenBSD.
> 
> (They're for OpenBSD v6.4.)
> 
> Any changes for 7.5, please, or should I just 'send it'?
> 
> (From the 'It's better to ask than to be told 'If only you'd asked.'',
> file.)
> 
> Thanks, in advance ...
> 
> *``` OpenBSD install MariaDB database server*
> 
> # pkg_add -v mariadb-server
> 
> *How to enable and start MariaDB server at boot time on OpenBSD*
> 
> # 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
> 
> *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
> 
> *Verify that MariDB service running and port is open*
> *
> /Run pgrep command to search 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 secure MariaDB installation*
> 
> */Run the following script:/*
> # mysql_secure_installation
> 
> *How to test MariaDB installation*
> *
> /Run the following mysql command:/*
> mysql -u root -p
> 
> *How to configure MariaDB on OpenBSD*
> 
> */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
> 
> ```

After a cursory reading, it looks OK.  But don't forget to read the
supplied documentation, after installing the package:

    less /usr/local/share/doc/pkg-readmes/mariadb-server

Also, most of those steps don't have to do with mariadb, but with simple
system administration.  Installing the package, starting and stopping
services, and checking if processes are running and ports are open are
all tasks you should be familiar with.

-- 
 

Reply via email to