Using Netbeans with Virtualmin server

SYSTEM INFORMATION
OS type and version REQUIRED
Virtualmin version REQUIRED

I am trying to debug a PHP program that accesses databases (MariaDB) on my server. One of the databases is very large and is difficult to transfer to a local machine. I would like to debug this program using my local Win11 machine using the databases on my Virtualmin server. It seems looking at the documentation with Netbeans that this is possible, but I am unable to get this to work after working on this for many hours.

I was wondering if anyone has any experience with this and can tell me what I need to do to get this to work or another program that I can run that will allow me to debug this problem. The program did work on my old server which was using CPanel, Centos and MySQL. I am now running Ubuntu, Virtualmin and MariaDB.

I suspect it is how MariaDB deals with this very large database. To be more detailed–I am running discussion list software on my server–Dadamail. I have 6 years of messages on this database which is stored on one table which is somewhat non-standard. I did not create this program that is how it is. I think my program is getting hung up reading some of the raw messages which are stored on this table. .

My program reads this database looking for new messages. Extracts the message and writes it to a Kunena table in Joomla.

So I need to debug this program to find out where the hiccup is. I am open to other debuging programs as I am not set on Netbeans which I have used on my local windows machine without problems.

Thanks,
Michael

Probably not what you want to hear (and probably more for the benefit of others) time to move to a dedicated database server? the MariaDb server with Virtualmin is not exactly intended for humungous databases. That is even more true for a database that has a single massive table. Time also to rationalise the database and look again at its indexing. Do you really need raw messages that are ancient and likely to be rarely searched? also that step of moving data to another table in another system sounds like a redundancy.

you have set maria to listen on 0.0.0.0 and made sure that the mysql port is open in the firewall ? this should allow you to read the data directly from whatever ide, that said I have not used Windows in 20+ years and have never used netbeans so it may not be capable of reading a remote mysql(ish) database.

You could use virtualmin’s backup facility to back up the data and then transfer that to your local machine and then import the mysql dump that is in the backup into a local database system, again I have no idea if netbeans can read mysql dumps.

if you have installed phpmyadmin on your virtualmin server you could also create a dump from there, however you may have to re configure php to allow a large database to be dumped.
You have not said what mysql errors your getting? This may be a simple fix as maria is no longer a ‘drop in’ replacement for mysql they have diverged and some mysql queries will not work with maria. So trying to debug with an ide that is mysql compatible may not show any errors, it maybe better looking at the queries that you app is trying to execute and see if they are maria compatible

You can configure the MariaDB database in a Virtualmin system in the same way you would configure any MariaDB database instance, including for big databases. It is not “our” MariaDB, it is the one provided by your OS; we don’t replace it with a custom one, and we don’t enforce any specific configuration.

That said, if you have a particularly heavy database app, it may be useful to isolate it from other apps just because it could cause resource contention problems for other apps, and tuning for an unusual user of the database might cause performance issues for other apps that have more common usage patterns.

I’d guess OPs problem is that they probably did some tuning or added some table indexes on the old system that has not been replicated in the new system. Current MariaDB (or MySQL) should be mostly faster for most workloads than an old MySQL, though there have been some reliability/safety/security changes that may cause performance degradation in some workloads.

Finally, database performance tuning is often specific to the application and workload. I have no experience with Dadamail, so I don’t have any suggestions for what tuning would be needed for performance for it.

It is not clear to me what problem you need help with.

What errors do you get? What exactly are you trying to do with Netbeans? I guess I don’t know what Netbeans is, I thought it was a Java application framework, but your post seems to indicate it’s also some kind of database tool?

Also, if you’re trying to solve a database problem on the web server, and the app that is having problems is Dadamail (a PHP app), I think you need to be looking at what’s happening on the server, not with the data, so I kinda doubt looking at it in Netbeans is useful
but, again, I’m guessing I don’t actually know what Netbeans is, so I may be missing some useful feature it has in this area.

I want to thank everyone for their input. I will try to answer some of the questions.

  1. Netbeans–will run on windows and Linux–It allows multiple different types of programs to be debugged. So I have used it on my local Windows machine using Wampserver64. It allows me to go in and step through a PHP program or setup breakpoints. According to the documentation, I should be able to use it to debug a program on a remote server but the instructions for that are not clear. I could never get Netbeans to talk to my server.
  2. I can see how to read my MariaDB database remotely and have successfully done that.
  3. Unfortunately, the database is too large to be read in with PHPmyadmin in Wampserver64 because it will not allow large values to be set in the PHP.INI file I tried several time to set these values to 3G which is what is needed to read in the .sql file but it resets back to 256M. I am able to set these values on my Virtualmin server without any problems.
  4. I also have Navicat and can connect up to the database on the server. When I try to copy it to a database on the local machine it cannot support the large reads of the text fields of one of the fields in my database.
  5. I was hoping someone had used Netbeans to run a program on the server so I could debug it there. Since I thought that I followed the directions, opened all the necessary ports on the firewall. added Xdebug to PHP but it did not work.
  6. Dadamail–is a Perl program that is a listserver. It is working on my new server using Ubuntu, Virtualmin and MariaDB. I have been using this program for 5 years and have accumulated thousands of messages. It uses a MySQL database. The table of interest has some large text fields and these often contain unusual characters. The database is around 4.0 gigs but the table of interest is 2.4 gigs currently. I could go into more detail but I dont think that matters except the size of the database makes it hard to work with.
  7. My program keeps an index of the last record read and looks at entries in this large table for newly entered rows. It then needs to look at one field called “raw messages” and find where a new message actually begins (much garbarge in the message) and were it ends. This is not easy because there are no specific ways t can easily tell this. I know Navicat has trouble reading all the entries on this table because of the raw message filed–the one that contains the information I need. This is why I think this is the problem.
  8. Note I am not asking how to fix my program–I just want to run a debugger so I can see where my program messes up so I can fix it.

Thanks,
Michael

Perl and PHP have step debuggers you can run on the command line on the server itself.

https://perldoc.perl.org/perldebug

https://xdebug.org/docs/dbgpClient

Assuming the problem is in the code and not the database itself. Since you’ve moved from MySQL to MariaDB it is always possible (though unlikely) that there is some difference that leads to your problem. But I think you’d have some errors in the log to work with, if that were the case.

I’m not clear on whether you’re able to look at your data in the local mysql or mariadb client on the server itself. If you can’t, you’ll presumably get some actionable/searchable errors. And, if the MariaDB’s own client can work with the database, and run the queries your apps are trying to run, then you know you have to look at the app(s). And, conversely, if you can’t successfully make those queries, you know it’s a database problem, and you’ll have errors you can work with.

Right now, there are way too many variables for me to try to wrap my head around what we’re trying to solve. Since I have never used NetBeans, I can’t help there. But, if you have a database problem, I might be able to help. If you have a Perl problem, I probably can help. If you have a PHP problem, I might be able to help.

So
we can make it a problem I can help with, or we can hope somebody else has used NetBeans in the way you’re trying to use it (but NetBeans questions are probably best asked of NetBeans users, I would assume they have a forum or mailing list, there is nothing about Virtualmin that would interact with or conflict with NetBeans
we do everything by the book and using OS standard packages with regard to running apps and databases).

Is it simply down to an encoding problem. were these text fields encoded differently when saved and just cannot be read when loading them? What characters are blowing it up?

Can you take a smaller cut of the table as a separate db and push that through the process without a hiccup?

Maybe on you local machine use Docker instead of Wamp.

I want to thank everyone who answered me. Because of the discussion i solved the issue. The problem was an coding issue dealing with a ’ in someone’s name messing up the add to database command. I am surprised that I didn’t see the problem previously in my old server.

Anyway I ended up running the program and debugger locally but accessed the database on the server. Once I did that found the problem easily.

In order to run Netbeans remotely I probably need to install netbeans on the server as well as the client I suspect. I might mess with this in the future but right now not necessary. If I learn more will update thread.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.