Good to see MariaDB is featured.

General discussions V2
vk2na
Novice Class
Posts: 7
Joined: 17 Nov 2020, 05:45

Good to see MariaDB is featured.

Post by vk2na »

Hi.

It is good to see that creating a mariadb is featured in the latest version. I had been playing around for weeks to get mariadb working but the latest version has a dropdown box option when you want to create a new SQL database. It worked perfectly!

Dave
vk2na
Novice Class
Posts: 7
Joined: 17 Nov 2020, 05:45

Re: Good to see MariaDB is featured.

Post by vk2na »

However, I see only the PC that created the MariaDB can access the log4om2 database.

Other PC's on my network are unable to access it.
SP5MTD
Novice Class
Posts: 14
Joined: 14 Feb 2025, 20:45

Re: Good to see MariaDB is featured.

Post by SP5MTD »

To create DB Log4OM uses whatever mariadb user you provided in create database form. In many cases it will be the root user. It is your job to create regular mariadb user and grant proper priviledges to access log4om database created that way. This includes user@host grant db statements. Also you may want to o check network rules. All hosts that are supposed to access mariadb must be allowed to do so on network level.
73 Mike SP5MTD
vk2na
Novice Class
Posts: 7
Joined: 17 Nov 2020, 05:45

Re: Good to see MariaDB is featured.

Post by vk2na »

Thanks Mike.

Appreciate the response.

I couldn't fix the access issue with multiple PC's on the same 192.168.X.X network. I don't have any issues using my domain-ip.org address. So I will use that. I have port forwarding etc.

The my.cfg host-port is 0.0.0.0 and my User for the database is 'username'.'%' .

I just increased the password security. I don't have SSL organised yet. Do you think SSL access is helpful?

Cheers,

Dave.
SP5MTD
Novice Class
Posts: 14
Joined: 14 Feb 2025, 20:45

Re: Good to see MariaDB is featured.

Post by SP5MTD »

No worries Dave.

I would suggest to first check network connectivity. You can do that using telnet on MariaDB host and port, from every PC you want to access it from, i.e.:

Code: Select all

telnet mariadb_host_name_or_ip 3306
If you get response like that:

Code: Select all

Connected to mariadb_host_name_or_ip.
Escape character is '^]'.
Z
11.7.2-MariaDB-ubu2404.pjF[wev?=A#'8'V^UnLojmysql_native_passwordConnection closed by foreign host.
you know that you have network setup right. If not, you need to check your connectivity, routing, firewall, etc.

Once network issues are off the way just check your if database was properly created by Log4OM (using 'Deploy MariaDB Database). To create the database you need to provide Log4OM with admin credentials, so usually root db account. Yes, you should use SSL. Log4OM will tell you if database creation was successful. If not, check if your root user can logon from anywhere ('%'):

Code: Select all

MariaDB [(none)]> SELECT user,host FROM mysql.user WHERE user='root';
+------+-----------+
| User | Host      |
+------+-----------+
| root | %         |   <--- this row must exist! it allows root to logon from any host, not only from localhost
| root | localhost |
+------+-----------+
2 rows in set (0.005 sec)
For regular usage you do not want to use root account. Thus you need to create dedicated user and grant it proper rights. Assuming your database is named log4om2 the below db commands set would do the job (you need to be logged to mariadb as root user to invoke them):

Code: Select all

MariaDB [(none)]> CREATE USER 'log4om_user'@'%' IDENTIFIED BY 'password_here';
Query OK, 0 rows affected (0.005 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON log4om2.* TO 'log4om_user'@'%';
Query OK, 0 rows affected (0.005 sec)

MariaDB [(none)]> SHOW GRANTS FOR 'log4om_user'@'%';
+------------------------------------------------------------------------------------------------------------+
| Grants for log4om_user@%                                                                                   |
+------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `log4om_user`@`%` IDENTIFIED BY PASSWORD '*933A8231EE7AD0CF1BBBEF8CD8961474D3D5749D' |
| GRANT ALL PRIVILEGES ON `log4om2`.* TO `log4om_user`@`%`                                                |
+------------------------------------------------------------------------------------------------------------+
2 rows in set (0.004 sec)
After that you should have properly setup log4om_user, able to logon from any PC with password_here and access database named log4om2.
73 Mike SP5MTD
vk2na
Novice Class
Posts: 7
Joined: 17 Nov 2020, 05:45

Re: Good to see MariaDB is featured.

Post by vk2na »

Thanks Mike,

That is a fantastic tutorial for newbies like me. All of those points you made do check out with my system and I did get the telnet refuse connection message on port 3306 as you described.

The only thing I don't have is 'root'@'%' and I'll add that. I do have 'root'@'localhost'.

I created a user separate from the 'log4om2User' default, and the second user has all privileges to the database log4om. My additional user is 'username'@'%' .

Really appreciate the user support on this. I hope also others may benefit from this info.

I'll next look at SSL. I have seen some good documentation on that process but it looks like a fiddle. Fortunately, I have backups in case I break things.

Thanks.

Dave
SP5MTD
Novice Class
Posts: 14
Joined: 14 Feb 2025, 20:45

Re: Good to see MariaDB is featured.

Post by SP5MTD »

Dave, few comments:
  • root@% is not necessary if MariaDB and Log4OM instance used to create database are on the same host, in such a case root@localhost is sufficient.
  • Standard log4om2User can be used as well. Just you need to change password to something known and check privileges (they are probably ok).
  • If you have no connectivity to port 3306 you can probably search no more. Fix that and you are good to go.
  • I’m not from user support. Just describing what worked for me. I’m sure that in time Log4OM team will provide much better documentation for new features. It is normal in open source than you want implement new things first, and cover it in documentation later on, especially for simple things like database connectivity.
Anyway I hope I helped a bit and you will have MariaDB up and running soon.
73 Mike SP5MTD
User avatar
G4POP
Log4OM Alpha Team
Posts: 11581
Joined: 21 Jan 2013, 14:55
Location: Burnham on Crouch, Essex UK

Re: Good to see MariaDB is featured.

Post by G4POP »

Hi Mike,
How do you feel about documenting the set up and use for inclussion in the user guide?
73 Terry G4POP
vk2na
Novice Class
Posts: 7
Joined: 17 Nov 2020, 05:45

Re: Good to see MariaDB is featured.

Post by vk2na »

Mike,

I have dropped the 'root'@'%' user. I now only have 'root'@'localhost'.

I have created SSL certificates using this guide.
https://www.cyberciti.biz/faq/how-to-se ... m-clients/

I stopped at the end of Section 8. With rsync command.

I jumped straight onto mariadb -u root -p and did:

GRANT ALL PRIVILEGES ON lo4om2.* TO 'my_user_name'@'%' REQUIRE SSL;
FLUSH PRIVILEGES;
exit

I went to log4om2 and I couldn't connect to the database until I checked SSL box. It looks like SSL is now working. I can access my MariaDB.

I will do more tests tomorrow.

Regards,

Dave
VK2NA
SP5MTD
Novice Class
Posts: 14
Joined: 14 Feb 2025, 20:45

Re: Good to see MariaDB is featured.

Post by SP5MTD »

G4POP wrote: 25 Feb 2025, 10:08 Hi Mike,
How do you feel about documenting the set up and use for inclussion in the user guide?
Hi Terry, happy to add my two cents on db setup in the user guide, if there are no strict time requirements :).
73 Mike SP5MTD
Post Reply