Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    mysql error: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (13 "Permission denied")

    Kopano Groupware Core
    sles12 sp1 permission deni mariadb-10.0.30 kopano-server-8
    2
    9
    4748
    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.
    • A Former User
      A Former User last edited by

      Today I updated my SLES 12 SP1 server to install WebApp 3.30. This also updated maria db to “mariadb-10.0.30-25.1.x86_64”. kopano was already on 8.3.0. Unfortunately kopano-server can’t connect to mysql:

      Wed May 17 20:05:01 2017: [error  ] KDatabase::Connect(): database access error -2147483641, mysql error: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (13 "Permission denied")
      Wed May 17 20:05:01 2017: [crit   ] Unable to connect to database: MYSQL not initialized
      Wed May 17 20:05:01 2017: [notice ] Waiting for mysql_server_end
      Wed May 17 20:05:01 2017: [notice ] Waiting for mysql_library_end
      Wed May 17 20:05:01 2017: [ notice] Server shutdown complete.
      

      I am able to connect to mysql:

      mysql -u root -p
      

      also the socket exists.

      As temporarily solution I modified kopano-server to connect to the server’s IP address.

      Are any known issues with “kopano-server-8.3.0~1042-2.1.x86_64” and “mariadb-10.0.30-25.1.x86_64”?

      Walter

      RemoStrotkamp 1 Reply Last reply Reply Quote 0
      • RemoStrotkamp
        RemoStrotkamp @Guest last edited by

        Can confirm this report.

        Switching from socket connection to tcp (127.0.0.1 instead of localhost in server.cfg) worked as well.

        SLES12 SP2

        1 Reply Last reply Reply Quote 0
        • A Former User
          A Former User last edited by

          Using 127.0.0.1 in server.cfg did not solved this issue in my case.

          1 Reply Last reply Reply Quote 0
          • A Former User
            A Former User last edited by

            Also socket seams correct:

            # l /var/run/mysql/mysql.sock
            srwxrwxrwx 1 mysql mysql 0 May 17 19:56 /var/run/mysql/mysql.sock=
            #
            
            1 Reply Last reply Reply Quote 0
            • RemoStrotkamp
              RemoStrotkamp last edited by RemoStrotkamp

              Could it be your mysql server is configured to only listen to it’s IP adress and not 127.0.0.1 in addition?

              (I think this is what happens if you specify the IP as the bind-address in my.conf. It will only listen on the eth interface associated with that IP. If you specify 0.0.0.0 (or leave commented out) mysql server will listen on all devices including the loopback)

              1 Reply Last reply Reply Quote 0
              • RemoStrotkamp
                RemoStrotkamp last edited by

                looks like some recent update by SuSE has changed the directory persmissions of /var/run/mysql to rwx------
                which gives processes running as neither root nor mysql access problems. Changing those permissions back to something a weebit more sensible fixes the errors…

                1 Reply Last reply Reply Quote 0
                • A Former User
                  A Former User last edited by

                  On all Systems I see this permissions:

                  srwxrwxrwx 1 mysql mysql 0 May  9 14:43 /var/run/mysqld/mysqld.sock=
                  

                  Checked on 3 systems. So I assume “srwxrwxrwx” is correct.

                  Which permissions you advice?

                  RemoStrotkamp 1 Reply Last reply Reply Quote 0
                  • RemoStrotkamp
                    RemoStrotkamp @Guest last edited by RemoStrotkamp

                    @WalterHof

                    check the directory, not the socket: /var/run/mysql/

                    they were drwx------ mysql mysql

                    1 Reply Last reply Reply Quote 0
                    • A Former User
                      A Former User last edited by

                      @RemoStrotkamp
                      You are right, on SLES 12 SP1 the directory permissions are incorrect:

                      drwx------  2 mysql  mysql    60 May 17 19:56 mysql/
                      

                      As example Debian 7:

                      drwxr-xr-x 2 mysql      root         80 May  9 14:43 mysqld/
                      

                      This are the propper permissions.

                      Thank you.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post