MySQL Forums
Forum List  »  Perl

authentication from .cgi scripts
Posted by: Alan Dunwell
Date: September 29, 2024 02:00PM

Howdy Gang,
New forum user here so let me know if I do anything off protocol.

I'm migrating some perl scripts from a CentOS7 machine to Alma9 and of course mysql/mariadb is a more recent version (10.5.22) and uses the new non-password type logins. Many of the .pl scripts are called from
/var/spool/cron/root
so of course they run even though the original scripts reference root@localhost and give a password. Since it is root runing the script it just ignores the PW bit.

However I also have .cgi scripts that use the same sort of DBI->connect type line for DB login. These script are getting run from a web page that runs the script and now it isn't root running the script and the login fails. In
/var/log/httpd/error_log I see lines like

[cgid:error] [pid 33953:tid 34123] [client 192.168.1.10:62362] DBI connect('xantrex:localhost','root',...) failed: Access denied for user 'root'@'localhost' at /usr/local/solar-web_monitor/cgi-bin/power_graph.cgi line 26.: /usr/local/solar-web_monitor/cgi-bin/power_graph.cgi

{I did not see a way to post code in a box here, please advise on that}

Line 26 is the DBI->connect line with the creds. Does anyone know the proper way to configure mysql/mariadb to be able to pass login credentials? I saw some references to mods to my.cnf to do
skip-networking+0
skip-bind-address
but was leery of that for maybe security reasons, not sure.

Please advise,
Alan D.

Options: ReplyQuote


Subject
Written By
Posted
authentication from .cgi scripts
September 29, 2024 02:00PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.