Install MYSQL or MYSQLI on pfsense 2.3 (Captive Portal)



  • Hello

    Am relatively new to pfsense and I would like to have either mysql or mysqli running on my pfsense box (I think).

    My reason for this is I have a client who has Captive Portal page currently displaying terms and conditions which users just accept before gaining internet access. They currently do not provide any user details, they just accept the terms, it's simple and it works fine.

    I would like to add a couple of fields to the captive portal where the users can enter their name, date of birth and email address before they press the "accept terms" button. I want to store this information in a database for later use.

    I do not want any authentication facilities, user logins or anything like that, just a log of the information.

    If a user visits on another date then they will just enter their details again and I'll get another line in the DB showing this.

    What is the best way to do this? I have found various articles for getting mysqli installed, but they all appear to be relating to older versions of pfsense. Not the v2.3 I am running.

    I managed to run

    pkg install php56-mysqli

    which say's its installed but now I'm lost.

    Any help greatly appreciated and I am open to any suggestions  :)
    Thanks.



  • Hi,

    Are you sure you need a MySQL server running on your firewall ? And thus, why having these install problems ?
    As a minimum (and maximum) you should activate "the mysql client part" in PHP, so you can communicate with a MYSQL server on your LAN (or elsewhere). Info about this can be found on this forum, although somewhat non-supported (means : it can be done, but you are on your own, pfSense is a firewall, not a multi server hosting device).

    If you were posting on the right place ( pfSense Forum » pfSense English Support » Captive Portal ) you would have found some info about MySQL right away.



  • @Gertjan:

    Hi,

    Are you sure you need a MySQL server running on your firewall ? And thus, why having these install problems ?
    As a minimum (and maximum) you should activate "the mysql client part" in PHP, so you can communicate with a MYSQL server on your LAN (or elsewhere). Info about this can be found on this forum, although somewhat non-supported (means : it can be done, but you are on your own, pfSense is a firewall, not a multi server hosting device).

    If you were posting on the right place ( pfSense Forum » pfSense English Support » Captive Portal ) you would have found some info about MySQL right away.

    Hi Gertjan
    Thanks for the reply.

    I understand regarding having a MYSQL server running elsewhere on the LAN, but I'm looking to run it all on the pfsense box so it's an "all-in-one" solution. I appreciate there are hardware requirements and security issues by doing this, but I accept those.  At the end of the day it's going to be pretty minimal processing and data storage.

    I posted this in the install section as I thought that the MYSQL install would be something that's outside of the captive portal. E.G. Something that could be used for other services, a captive portal being just one option.



  • Did this https://forum.pfsense.org/index.php?topic=108493.0 ( from "Topic: [HOWTO] Captive portal + FreeRADIUS + local MySQL user friendly single step " which you can find in the Captive Portal forum ) which is also tested for 2.3 didn't work for you ?



  • @Gertjan:

    Did this https://forum.pfsense.org/index.php?topic=108493.0 ( from "Topic: [HOWTO] Captive portal + FreeRADIUS + local MySQL user friendly single step " which you can find in the Captive Portal forum ) which is also tested for 2.3 didn't work for you ?

    Unfortunately not no. It fails to install the SQL correctly. Plus I don't really need the RADIUS parts. I just want a simple way of running MySQL on the pfSense box. I'm sure I can modify my captive portal php form to post to the sql server as well as the pfsense captive portal system for logging the user. Just the same as if the sql server was external etc.

    Am I going about this the wrong way perhaps?



  • @jmonline:

    Unfortunately not no. It fails to install the SQL correctly.

    What about replying to that subject ?
    Just post to it with your detailed scenario what you're typing (SSH access), and the answers.

    The author of the "how-to" stated that he used a native 2.3-RELEASE to activate, among other, MySQL, on pfSense.

    @jmonline:

    Plus I don't really need the RADIUS parts.

    You just take from the How-to what you need.

    @jmonline:

    I just want a simple way of running MySQL on the pfSense box. I'm sure I can modify my captive portal php form to post to the sql server as well as the pfsense captive portal system for logging the user. Just the same as if the sql server was external etc.

    That's what's the how-to all about.



  • Yeah I posted on that topic earlier so will see what they come back with.


Log in to reply