Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Access remote database via portal

    Scheduled Pinned Locked Moved General pfSense Questions
    2 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pedenski
      last edited by

      i uploaded a .php file in the captive portal that accesses remote database on my LAN network.

      mysql_connect("192.168.8.136", "root","admin") or die(mysql_error());
      echo "Connected to MySQL Server
      ";
      mysql_select_db ("web") or die (mysql_error());
      echo "database connected
      ";

      but im getting this error
      Fatal error: Call to undefined function mysql_connect() in /var/etc/captiveportal.html on line 5
      my line 5 is "mysql_connect("192.168.8.136", "root","admin") or die(mysql_error());"

      i have already opened ports and provided access to my remote database. do i need to include a rule inside pfsense to allow negotiations with my remote mysql?

      1 Reply Last reply Reply Quote 0
      • F
        freeman35
        last edited by

        mysql server not run, so you can't connect. My problem is same, if open shell in pfsense and write this in console "service mysql-server onestart" if you install mysql-serverxxx packet it will start and connect.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.