Welcome, Guest. Please login or register.

Author Topic: NeDI 1.9 - is there a way to point to a custom MySQL socket file?  (Read 2427 times)

janet

  • Newbie
  • *
  • Posts: 5
    • View Profile
NeDI 1.9 - is there a way to point to a custom MySQL socket file?
« on: September 25, 2020, 11:44:03 am »
I tried setting dbhost to the path to my socket, but it didn't work.  Is there a way to use a socket?

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2901
    • View Profile
    • NeDi
Re: NeDI 1.9 - is there a way to point to a custom MySQL socket file?
« Reply #1 on: October 07, 2020, 10:22:17 am »
I haven't considered this scenario yet. How are you running this?
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

janet

  • Newbie
  • *
  • Posts: 5
    • View Profile
NeDI 1.9 - Custom Port?
« Reply #2 on: October 11, 2020, 09:22:47 am »
Well, I was trying to work around a problem I had with NeDi and my mariadb.  Our security folk won't let us run databases on default ports or sockets.  While I can define dbhost like this:

dbhost      127.0.0.1:3402

Only nedi.pl works.  The web GUI doesn't.  Really, all I want is the ability to do this in the config:

dbhost      127.0.0.1
dbport      3402
cactihost  127.0.0.1
cactiport   3402

Right now I use 127.0.0.1:3402 for dbhost and cactihost, and hacked /html/inc/libdb-mysql.php.  That said, my solution is ugly - I don't know php, so I just did this:

function DbConnect($host,$user,$pass,$db){
        $host = '127.0.0.1';
        $port = 3402;
        $l = mysqli_connect($host,$user,$pass,$db,$port) or die("Could not connect to $db@$host $port with $user");
        mysqli_set_charset($l, "utf8");                                                                 # Some stubborn servers need this, tx Nils
        return $l;
}

It works, but its an ugly hard coded hack. 

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2901
    • View Profile
    • NeDi
Re: NeDI 1.9 - is there a way to point to a custom MySQL socket file?
« Reply #3 on: October 12, 2020, 12:12:01 pm »
As long as it works :-) I'll add support for this and packport to NeDi 2.0 Patch3...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo