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

    Mysql doesn't work after upgrade pfsense from 2.6 to 2.7

    General pfSense Questions
    5
    14
    1.3k
    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.
    • V
      vahidmoghadam
      last edited by

      Hi,

      I was using pfSense 2.6 along with freeRadius with a MySQL database authentication and I had no problems. Everything was normal.
      When I tried to update to pfSense 2.7, all the packages were successfully downloaded and installed, and I did not receive any error messages while receiving and installing the packages.
      Now the freeRadius service does not start because the MySQL service is not started. Also, the MySQL service does not run and I get the following error message when I try to start it:

      ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
      

      Also, I have Crash Report on the pfSense web interface:

      Crash report begins.  Anonymous machine information:
      
      amd64
      14.0-CURRENT
      FreeBSD 14.0-CURRENT #1 RELENG_2_7_0-n255866-686c8d3c1f0: Wed Jun 28 04:21:19 UTC 2023     root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/obj/amd64/LwYAddCr/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/sources/FreeBSD-src-REL
      
      Crash report details:
      
      PHP Errors:
      [10-Aug-2023 15:12:07 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/local/lib/php/20220829/mysqli.so (Cannot open "/usr/local/lib/php/20220829/mysqli.so"), /usr/local/lib/php/20220829/mysqli.so.so (Cannot open "/usr/local/lib/php/20220829/mysqli.so.so")) in Unknown on line 0
      

      I was really looking for a solution to solve the problem, but all of them were useless. please help me

      S 1 Reply Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @vahidmoghadam
        last edited by

        @vahidmoghadam That sounds like it didn't get installed properly? Easiest would be to uninstall and reinstall FreeRADIUS.

        Ensure you have clicked save on the settings page at least once (ever) before doing so, or some settings get left out during reinstall/restore.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote ๐Ÿ‘ helpful posts!

        V 1 Reply Last reply Reply Quote 1
        • V
          vahidmoghadam @SteveITS
          last edited by

          @SteveITS
          Thanks for your answer,

          Are you sure that my problem solve with reinstalling FreeRadius? my MySQL can not be run, Do you think with reinstalling FreeRADIUS MySQL will be repaired?

          Thanks

          S 1 Reply Last reply Reply Quote 0
          • S
            SteveITS Galactic Empire @vahidmoghadam
            last edited by

            @vahidmoghadam I was guessing. Uninstalling and reinstalling should be safe unless you've unchecked the option to "Keep Settings/Data." If that doesn't work then the brute force approach would be to install 2.7 from scratch and then restore your config file from backup.

            As a small bonus reinstalling would use the ZFS file system.

            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
            Upvote ๐Ÿ‘ helpful posts!

            V 1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Hmm mysqli.so doesn't exist in pfSense after installing Freeradius. But it also doesn't exist in 2.6.
              Did you install anything custom there?

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                Ah, it's in the php82-mysqli-8.2.6.pkg
                Make sure you have that installed

                1 Reply Last reply Reply Quote 0
                • V
                  vahidmoghadam @SteveITS
                  last edited by

                  @SteveITS @stephenw10

                  Actually, the source of my problem is related to the MySQL service, It can not be started.

                  Now I installed a new version and fresh pfSense on another physical machine, then installed the FreeRADIUS, everything was OK and FreeRADIUS started and worked normally, When I enabled the MySQL connection in FreeRADIUS, the FreeRADIUS service stopped because the MySQL service was not running.

                  and again I get this error when I try to start MySQL even on fresh pfSense.

                  ERROR 2002 (HY00): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    What exactly are you enabling in Freeradius that triggers this?

                    Did the mysql php pkg get installed correctly the second time you tested?

                    V 1 Reply Last reply Reply Quote 0
                    • jimpJ jimp moved this topic from Problems Installing or Upgrading pfSense Software on
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      There is no "MySQL Service" on pfSense. Even with the PHP MySQL module installed it is only capable of acting as a client to contact a MySQL server on another host.

                      Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 1
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        Yup, feels like there may have been something custom running...

                        1 Reply Last reply Reply Quote 0
                        • V
                          vahidmoghadam
                          last edited by

                          MySQL service is available on pfSense 2.6 but in 2.7 It doesn't work correctly

                          GertjanG 1 Reply Last reply Reply Quote 0
                          • V
                            vahidmoghadam @stephenw10
                            last edited by

                            @stephenw10

                            I enabled SQL Support in FreeRADIUS to connect a MySQL authorization database

                            1 Reply Last reply Reply Quote 0
                            • GertjanG
                              Gertjan @vahidmoghadam
                              last edited by

                              @vahidmoghadam

                              Running a MySQL server on pfSense ??
                              Read and sign off the Using Software from FreeBSD.
                              Be aware : totally not supported, so you have to support it by yourself, as you already did it ones : if you had a MySQL server running on your 2.6.0 then you installed that yourself.
                              So, do it again !?

                              I advise you to read several threads found here (just click) as they all have the same question : how to install mysql server on pfsense and nearly always the same answer : please don't.

                              No "help me" PM's please. Use the forum, the community will thank you.
                              Edit : and where are the logs ??

                              1 Reply Last reply Reply Quote 0
                              • stephenw10S
                                stephenw10 Netgate Administrator
                                last edited by

                                Are you able to show the MySQL service in 2.6? It doesn't exist AFAIK. This could also just be terminology confusion.

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