Ad Widget

Collapse

Error "No such file or directory" After move the DB directory to another partition

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jolalla
    Member
    • May 2021
    • 45

    #1

    Error "No such file or directory" After move the DB directory to another partition

    Hello all

    I need your help. Please.

    Install a new zabbix server with the following features:
    Centos7
    Zabbix version: 5.0
    Mysql: 15.1 Distrib: 10.4.19 Maria DB
    PHP 7.2

    it's a fresh install so i have nothing to back up because i haven't added any hosts yet.
    On the centos server create a partition for the DB (/ data). I followed the instructions on how to change the mysql database directory. I validated it with @@ datadir inside mysql and it was correct in:
    : / data / mysql

    But the web interface is not working for me now. shows me error:

    Database error
    No such file or directory

    I went to the php.ini configuration file located at:
    /etc/opt/remi/php72/php.ini and there add the new socket path and it looks like this:

    pdo_mysql.default_socket=/data/mysql/mysql.sock


    mysqli.default_socket =/data/mysql/mysql.sock


    And restart the service httpd But it still doesn't work for me, what else should I modify?

    Thank you very much for your help.

    I leave here the error message that gives me and how is the directory of the DB after having changed it to the new partition.

    Thanks again.

    Attached Files
  • james.cook000@gmail.com
    Member
    • Apr 2018
    • 49

    #2
    Hi jolalla,

    Am I safe to assume the database and schema have been created and the server is running?

    If its just the Web component not working and having a reasonable guess at the error message: I think the socket permissions are not allowing apache/nginx user access.

    Check the perms on /data, the child directories and the socket itself.

    Just curious... the socket location is somewhere usually readable by all like /tmp/mysql.sock or /var/lib/mysql.sock?

    I mention this as you don't want to exposed your actual mysql data files if they are under/data? And I would use one of these locations instead of the data directory.

    Cheers
    James

    Comment

    • jolalla
      Member
      • May 2021
      • 45

      #3
      Hello James.Cook really thanks for answer

      I'm totally new to Zabbix and I'm not a Linux expert, so that's why it's been a bit difficult for me, sorry.

      I installed the zabbix server by watching tutorials on the internet.

      How valid or how do I grant the permissions to that new / data directory? because I have read some things that suggest that it may be that.

      Answering your other question the Socket as I see this in the new partition to which I moved the DB. is here:
      /data/mysql/mysql.sock

      Anyway I'll leave an image of it and the file My.cnf where I copy the new path of the DB

      Really thanks

      Attached Files

      Comment

      • jolalla
        Member
        • May 2021
        • 45

        #4
        Sorry James

        I forgot to comment that yes, the zabbix server and mysql services are running as well as apache. Anyway I leave here images of the status of these services.

        Thanks a lot.
        Attached Files

        Comment

        • jolalla
          Member
          • May 2021
          • 45

          #5
          Hello all,

          Someone who can give me a hand? I still have the problem. : (

          Thanks again.

          Comment

          • jolalla
            Member
            • May 2021
            • 45

            #6
            Hello [email protected] or who can help me please, hehe ; )

            Any idea what else could be happening that my front end doesn't work after moving the DB directory?

            Thanks for your help

            Comment

            • james.cook000@gmail.com
              Member
              • Apr 2018
              • 49

              #7
              Hi Jolalla,


              1st, lets check if the socket is actually there (as root or sudo):

              * ls -la /data/mysql/mysql.sock

              2nd, lets see the permissions (as root or sudo)

              * ls -la /data
              * ls -la /data/mysql
              * ls -la /data/mysql/mysql.sock

              3rd, lets see if the web users can read the socket (nginx/apache)

              * /bin/su -s /bin/bash -c '[ -r /data/mysql/mysql.sock ] || echo "Not-Readable"' nginx
              * /bin/su -s /bin/bash -c '[ -r /data/mysql/mysql.sock ] || echo "Not-Readable"' apache

              After that we can decide what needs to be done to resolve this issue.

              Cheers
              James

              Comment

              • jolalla
                Member
                • May 2021
                • 45

                #8
                Hello [email protected]

                Sorry how I mentioned it at first I am not an expert in Linux and less in zabbix, just copy and paste the commands that you sent me. And here I leave you the results that they threw me. I really appreciate your help.


                [root@zabbixmonitor ~]# ls -la /data/mysql/mysql.sock
                srwxrwxrwx 1 mysql mysql 0 Jun 1 13:14 /data/mysql/mysql.sock



                [root@zabbixmonitor ~]# ls -la / data
                ls: cannot access data: No such file or directory
                /:
                total 20
                dr-xr-xr-x. 18 root root 256 May 28 11:59 .
                dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                -rw-r--r-- 1 root root 0 May 28 11:59 .autorelabel
                lrwxrwxrwx. 1 root root 7 May 27 18:10 bin -> usr/bin
                dr-xr-xr-x. 5 root root 4096 May 28 11:59 boot
                drwxr-xr-x. 3 root root 19 May 31 12:06 data
                drwxr-xr-x 19 root root 3180 Jun 1 13:14 dev
                drwxr-xr-x. 84 root root 8192 Jun 1 13:14 etc
                drwxr-xr-x. 2 root root 6 Apr 11 2018 home
                lrwxrwxrwx. 1 root root 7 May 27 18:10 lib -> usr/lib
                lrwxrwxrwx. 1 root root 9 May 27 18:10 lib64 -> usr/lib64
                drwxr-xr-x. 2 root root 6 Apr 11 2018 media
                drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
                drwxr-xr-x. 4 root root 28 May 28 11:29 opt
                dr-xr-xr-x 208 root root 0 Jun 1 09:14 proc
                dr-xr-x---. 3 root root 188 Jun 1 13:13 root
                drwxr-xr-x 25 root root 720 Jun 1 13:14 run
                lrwxrwxrwx. 1 root root 8 May 27 18:10 sbin -> usr/sbin
                drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
                dr-xr-xr-x 13 root root 0 Jun 2 19:51 sys
                drwxrwxrwt. 13 root root 4096 Jun 2 20:02 tmp
                drwxr-xr-x. 13 root root 155 May 27 18:10 usr
                drwxr-xr-x. 20 root root 278 May 28 11:42 var




                [root@zabbixmonitor ~]# ls -la / data / mysql
                ls: cannot access data: No such file or directory
                ls: cannot access mysql: No such file or directory
                /:
                total 20
                dr-xr-xr-x. 18 root root 256 May 28 11:59 .
                dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                -rw-r--r-- 1 root root 0 May 28 11:59 .autorelabel
                lrwxrwxrwx. 1 root root 7 May 27 18:10 bin -> usr/bin
                dr-xr-xr-x. 5 root root 4096 May 28 11:59 boot
                drwxr-xr-x. 3 root root 19 May 31 12:06 data
                drwxr-xr-x 19 root root 3180 Jun 1 13:14 dev
                drwxr-xr-x. 84 root root 8192 Jun 1 13:14 etc
                drwxr-xr-x. 2 root root 6 Apr 11 2018 home
                lrwxrwxrwx. 1 root root 7 May 27 18:10 lib -> usr/lib
                lrwxrwxrwx. 1 root root 9 May 27 18:10 lib64 -> usr/lib64
                drwxr-xr-x. 2 root root 6 Apr 11 2018 media
                drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
                drwxr-xr-x. 4 root root 28 May 28 11:29 opt
                dr-xr-xr-x 208 root root 0 Jun 1 09:14 proc
                dr-xr-x---. 3 root root 188 Jun 1 13:13 root
                drwxr-xr-x 25 root root 720 Jun 1 13:14 run
                lrwxrwxrwx. 1 root root 8 May 27 18:10 sbin -> usr/sbin
                drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
                dr-xr-xr-x 13 root root 0 Jun 2 19:51 sys
                drwxrwxrwt. 13 root root 4096 Jun 2 20:03 tmp
                drwxr-xr-x. 13 root root 155 May 27 18:10 usr
                drwxr-xr-x. 20 root root 278 May 28 11:42 var

                /:
                total 20
                dr-xr-xr-x. 18 root root 256 May 28 11:59 .
                dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                -rw-r--r-- 1 root root 0 May 28 11:59 .autorelabel
                lrwxrwxrwx. 1 root root 7 May 27 18:10 bin -> usr/bin
                dr-xr-xr-x. 5 root root 4096 May 28 11:59 boot
                drwxr-xr-x. 3 root root 19 May 31 12:06 data
                drwxr-xr-x 19 root root 3180 Jun 1 13:14 dev
                drwxr-xr-x. 84 root root 8192 Jun 1 13:14 etc
                drwxr-xr-x. 2 root root 6 Apr 11 2018 home
                lrwxrwxrwx. 1 root root 7 May 27 18:10 lib -> usr/lib
                lrwxrwxrwx. 1 root root 9 May 27 18:10 lib64 -> usr/lib64
                drwxr-xr-x. 2 root root 6 Apr 11 2018 media
                drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
                drwxr-xr-x. 4 root root 28 May 28 11:29 opt
                dr-xr-xr-x 208 root root 0 Jun 1 09:14 proc
                dr-xr-x---. 3 root root 188 Jun 1 13:13 root
                drwxr-xr-x 25 root root 720 Jun 1 13:14 run
                lrwxrwxrwx. 1 root root 8 May 27 18:10 sbin -> usr/sbin
                drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
                dr-xr-xr-x 13 root root 0 Jun 2 19:51 sys
                drwxrwxrwt. 13 root root 4096 Jun 2 20:03 tmp
                drwxr-xr-x. 13 root root 155 May 27 18:10 usr
                drwxr-xr-x. 20 root root 278 May 28 11:42 va




                [root@zabbixmonitor ~]# ls -la /data/mysql/mysql.sock
                srwxrwxrwx 1 mysql mysql 0 Jun 1 13:14 /data/mysql/mysql.sock



                [root@zabbixmonitor ~]# / bin / su -s / bin / bash -c '[-r /data/mysql/mysql.sock] || echo "No legible" 'nginx
                -bash: /: Is a directory


                [root@zabbixmonitor ~]# / bin / su -s / bin / bash -c' [-r /data/mysql/mysql.sock] || echo "Not-Readable" 'apache
                -bash: /: Is a directory











                Comment

                • jolalla
                  Member
                  • May 2021
                  • 45

                  #9
                  And [email protected] Here I leave you the version information of PHP and Apache that I have installed. In case this information can be useful.
                  Thanks.

                  [root@zabbixmonitor ~]# httpd -v
                  Server version: Apache/2.4.6 (CentOS)
                  Server built: Nov 16 2020 16:18:20
                  [root@zabbixmonitor ~]# php --version
                  PHP 7.2.34 (cli) (built: Apr 28 2021 07:30:49) ( NTS )
                  Copyright (c) 1997-2018 The PHP Group
                  Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

                  Comment

                  • james.cook000@gmail.com
                    Member
                    • Apr 2018
                    • 49

                    #10
                    Originally posted by jolalla
                    Hello [email protected]

                    Sorry how I mentioned it at first I am not an expert in Linux and less in zabbix, just copy and paste the commands that you sent me. And here I leave you the results that they threw me. I really appreciate your help.


                    [root@zabbixmonitor ~]# ls -la /data/mysql/mysql.sock
                    srwxrwxrwx 1 mysql mysql 0 Jun 1 13:14 /data/mysql/mysql.sock



                    [root@zabbixmonitor ~]# ls -la / data
                    ls: cannot access data: No such file or directory
                    /:
                    total 20
                    dr-xr-xr-x. 18 root root 256 May 28 11:59 .
                    dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                    -rw-r--r-- 1 root root 0 May 28 11:59 .autorelabel
                    lrwxrwxrwx. 1 root root 7 May 27 18:10 bin -> usr/bin
                    dr-xr-xr-x. 5 root root 4096 May 28 11:59 boot
                    drwxr-xr-x. 3 root root 19 May 31 12:06 data
                    drwxr-xr-x 19 root root 3180 Jun 1 13:14 dev
                    drwxr-xr-x. 84 root root 8192 Jun 1 13:14 etc
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 home
                    lrwxrwxrwx. 1 root root 7 May 27 18:10 lib -> usr/lib
                    lrwxrwxrwx. 1 root root 9 May 27 18:10 lib64 -> usr/lib64
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 media
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
                    drwxr-xr-x. 4 root root 28 May 28 11:29 opt
                    dr-xr-xr-x 208 root root 0 Jun 1 09:14 proc
                    dr-xr-x---. 3 root root 188 Jun 1 13:13 root
                    drwxr-xr-x 25 root root 720 Jun 1 13:14 run
                    lrwxrwxrwx. 1 root root 8 May 27 18:10 sbin -> usr/sbin
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
                    dr-xr-xr-x 13 root root 0 Jun 2 19:51 sys
                    drwxrwxrwt. 13 root root 4096 Jun 2 20:02 tmp
                    drwxr-xr-x. 13 root root 155 May 27 18:10 usr
                    drwxr-xr-x. 20 root root 278 May 28 11:42 var




                    [root@zabbixmonitor ~]# ls -la / data / mysql
                    ls: cannot access data: No such file or directory
                    ls: cannot access mysql: No such file or directory
                    /:
                    total 20
                    dr-xr-xr-x. 18 root root 256 May 28 11:59 .
                    dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                    -rw-r--r-- 1 root root 0 May 28 11:59 .autorelabel
                    lrwxrwxrwx. 1 root root 7 May 27 18:10 bin -> usr/bin
                    dr-xr-xr-x. 5 root root 4096 May 28 11:59 boot
                    drwxr-xr-x. 3 root root 19 May 31 12:06 data
                    drwxr-xr-x 19 root root 3180 Jun 1 13:14 dev
                    drwxr-xr-x. 84 root root 8192 Jun 1 13:14 etc
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 home
                    lrwxrwxrwx. 1 root root 7 May 27 18:10 lib -> usr/lib
                    lrwxrwxrwx. 1 root root 9 May 27 18:10 lib64 -> usr/lib64
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 media
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
                    drwxr-xr-x. 4 root root 28 May 28 11:29 opt
                    dr-xr-xr-x 208 root root 0 Jun 1 09:14 proc
                    dr-xr-x---. 3 root root 188 Jun 1 13:13 root
                    drwxr-xr-x 25 root root 720 Jun 1 13:14 run
                    lrwxrwxrwx. 1 root root 8 May 27 18:10 sbin -> usr/sbin
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
                    dr-xr-xr-x 13 root root 0 Jun 2 19:51 sys
                    drwxrwxrwt. 13 root root 4096 Jun 2 20:03 tmp
                    drwxr-xr-x. 13 root root 155 May 27 18:10 usr
                    drwxr-xr-x. 20 root root 278 May 28 11:42 var

                    /:
                    total 20
                    dr-xr-xr-x. 18 root root 256 May 28 11:59 .
                    dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                    -rw-r--r-- 1 root root 0 May 28 11:59 .autorelabel
                    lrwxrwxrwx. 1 root root 7 May 27 18:10 bin -> usr/bin
                    dr-xr-xr-x. 5 root root 4096 May 28 11:59 boot
                    drwxr-xr-x. 3 root root 19 May 31 12:06 data
                    drwxr-xr-x 19 root root 3180 Jun 1 13:14 dev
                    drwxr-xr-x. 84 root root 8192 Jun 1 13:14 etc
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 home
                    lrwxrwxrwx. 1 root root 7 May 27 18:10 lib -> usr/lib
                    lrwxrwxrwx. 1 root root 9 May 27 18:10 lib64 -> usr/lib64
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 media
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 mnt
                    drwxr-xr-x. 4 root root 28 May 28 11:29 opt
                    dr-xr-xr-x 208 root root 0 Jun 1 09:14 proc
                    dr-xr-x---. 3 root root 188 Jun 1 13:13 root
                    drwxr-xr-x 25 root root 720 Jun 1 13:14 run
                    lrwxrwxrwx. 1 root root 8 May 27 18:10 sbin -> usr/sbin
                    drwxr-xr-x. 2 root root 6 Apr 11 2018 srv
                    dr-xr-xr-x 13 root root 0 Jun 2 19:51 sys
                    drwxrwxrwt. 13 root root 4096 Jun 2 20:03 tmp
                    drwxr-xr-x. 13 root root 155 May 27 18:10 usr
                    drwxr-xr-x. 20 root root 278 May 28 11:42 va




                    [root@zabbixmonitor ~]# ls -la /data/mysql/mysql.sock
                    srwxrwxrwx 1 mysql mysql 0 Jun 1 13:14 /data/mysql/mysql.sock



                    [root@zabbixmonitor ~]# / bin / su -s / bin / bash -c '[-r /data/mysql/mysql.sock] || echo "No legible" 'nginx
                    -bash: /: Is a directory


                    [root@zabbixmonitor ~]# / bin / su -s / bin / bash -c' [-r /data/mysql/mysql.sock] || echo "Not-Readable" 'apache
                    -bash: /: Is a directory










                    *** [root@zabbixmonitor ~]# ls -la / data


                    The above has a additional spaces and should be: ls -la /data


                    *** [root@zabbixmonitor ~]# ls -la / data / mysql


                    The above has a additional spaces and should be: ls -la /data/mysql


                    *** [root@zabbixmonitor ~]# / bin / su -s / bin / bash -c '[-r /data/mysql/mysql.sock] || echo "No legible" 'nginx


                    The above has a additional spaces and should be: /bin/su -s /bin/bash -c '[ -r /data/mysql/mysql.sock ] || echo "Not-Readable"' nginx


                    *** [root@zabbixmonitor ~]# / bin / su -s / bin / bash -c '[-r /data/mysql/mysql.sock] || echo "No legible" 'apache


                    The above has a additional spaces and should be: /bin/su -s /bin/bash -c '[ -r /data/mysql/mysql.sock ] || echo "Not-Readable"' apache


                    I would suggest copy/paste into notepad or notepad++ and then copy to command line...

                    Comment

                    • jolalla
                      Member
                      • May 2021
                      • 45

                      #11
                      Hello [email protected] Sorry, I hope I did well this time. Thanks : )



                      [root@zabbixmonitor ~]# ls -la /data
                      total 0
                      drwxr-xr-x. 3 root root 19 May 31 12:06 .
                      dr-xr-xr-x. 18 root root 256 May 28 11:59 ..
                      drwxr-xr-x. 5 mysql mysql 265 Jun 1 13:14 mysql



                      [root@zabbixmonitor ~]# ls -la /data/mysql
                      total 188492
                      drwxr-xr-x. 5 mysql mysql 265 Jun 1 13:14 .
                      drwxr-xr-x. 3 root root 19 May 31 12:06 ..
                      -rw-rw----. 1 mysql mysql 32768 Jun 3 06:53 aria_log.00000001
                      -rw-rw----. 1 mysql mysql 52 Jun 3 06:53 aria_log_control
                      -rw-rw---- 1 mysql mysql 14039 Jun 1 13:14 ib_buffer_pool
                      -rw-rw----. 1 mysql mysql 79691776 Jun 3 10:16 ibdata1
                      -rw-rw----. 1 mysql mysql 50331648 Jun 3 10:16 ib_logfile0
                      -rw-rw----. 1 mysql mysql 50331648 Jun 2 21:43 ib_logfile1
                      -rw-rw---- 1 mysql mysql 12582912 Jun 1 13:14 ibtmp1
                      -rw-rw----. 1 mysql mysql 0 May 28 11:33 multi-master.info
                      drwx------. 2 mysql mysql 4096 May 28 11:33 mysql
                      srwxrwxrwx 1 mysql mysql 0 Jun 1 13:14 mysql.sock
                      drwx------. 2 mysql mysql 20 May 28 11:33 performance_schema
                      drwx------. 2 mysql mysql 12288 May 28 11:44 zabbix
                      -rw-rw---- 1 mysql mysql 5 Jun 1 13:14 zabbixmonitor.pid



                      [root@zabbixmonitor ~]# /bin/su -s /bin/bash -c '[-r/data/mysql/mysql.sock] || echo "Not-Readable" ' apache
                      bash: [-r/data/mysql/mysql.sock]: Permission denied
                      Not-Readable



                      [root@zabbixmonitor ~]# /bin/su -s /bin /bash -c '[-r/data/mysql/mysql.sock] | | echo "No legible" 'nginx
                      su: user /bash does not exist



                      Comment

                      • james.cook000@gmail.com
                        Member
                        • Apr 2018
                        • 49

                        #12
                        The perms look fine so it's not that. Have you put in place or updated the zabbix Web config file to reflect the new socket? I.e. in the /etc/zabbix/web.... this is the next thing I would look at... what's the contents of the config file - exclude any confidential information please....

                        Comment

                        • jolalla
                          Member
                          • May 2021
                          • 45

                          #13
                          Hello [email protected] thank you one more time

                          I went to the path etc/zabbix/web and there I opened the file zabbix.conf.php but I did not see information related to the socket.
                          The content of this is as follows:


                          // Zabbix GUI configuration file.

                          $DB['TYPE'] = 'MYSQL';
                          $DB['SERVER'] = 'localhost';
                          $DB['PORT'] = '0';
                          $DB['DATABASE'] = 'XXXXXX';
                          $DB['USER'] = 'XXXXXX';
                          $DB['PASSWORD'] = 'XXXXXX';

                          // Schema name. Used for PostgreSQL.
                          $DB['SCHEMA'] = '';

                          // Used for TLS connection.
                          $DB['ENCRYPTION'] = false;
                          $DB['KEY_FILE'] = '';
                          $DB['CERT_FILE'] = '';
                          $DB['CA_FILE'] = '';
                          $DB['VERIFY_HOST'] = false;
                          $DB['CIPHER_LIST'] = '';

                          // Use IEEE754 compatible value range for 64-bit Numeric (float) history values.
                          // This option is enabled by default for new Zabbix installations.
                          // For upgraded installations, please read database upgrade notes before enabling this option.
                          $DB['DOUBLE_IEEE754'] = true;

                          $ZBX_SERVER = 'localhost';
                          $ZBX_SERVER_PORT = '10051';
                          $ZBX_SERVER_NAME = 'zabbixmonitor';

                          $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

                          // Uncomment this block only if you are using Elasticsearch.
                          // Elasticsearch url (can be string if same url is used for all types).
                          //$HISTORY['url'] = [
                          // 'uint' => 'http://localhost:9200',
                          // 'text' => 'http://localhost:9200'
                          //];
                          // Value types stored in Elasticsearch.
                          //$HISTORY['types'] = ['uint', 'text'];


                          // Used for SAML authentication.
                          // Uncomment to override the default paths to SP private key, SP and IdP X.509 certificates, and to set extra settings.
                          //$SSO['SP_KEY'] = 'conf/certs/sp.key';
                          //$SSO['SP_CERT'] = 'conf/certs/sp.crt';
                          //$SSO['IDP_CERT'] = 'conf/certs/idp.crt';
                          //$SSO['SETTINGS'] = [];

                          Comment

                          • jolalla
                            Member
                            • May 2021
                            • 45

                            #14
                            [email protected] The places where I found socket information and where I added the new path where the socket is located was here:
                            etc/opt /remi/php72/php.ini and here add the information like this:

                            ; Default socket name for local MySQL connects. If empty, uses the built-in
                            ; MySQL defaults.
                            ; http://php.net/pdo_mysql.default-socket
                            pdo_mysql.default_socket=/data/mysql/mysql.sock


                            ; Default socket name for local MySQL connects. If empty, uses the built-in
                            ; MySQL defaults.
                            ; http://php.net/mysqli.default-socket
                            mysqli.default_socket=/data/mysql/mysql.sock


                            And the other place where I found information about the socket and where I also added the new path was here:
                            etc/zabbix/zabbix_server.conf and here add the information like this:


                            ### Option: DBSocket
                            # Path to MySQL socket.
                            #
                            # Mandatory: no
                            # Default:
                            DBSocket=/data/mysql/mysql.sock


                            I added this information to you in case it can be useful and to know if what I add is right or wrong. In the same way, with that added, it doesn't work for me: (
                            Those config bring more information but I only copied the extracts where information appears from the socket that was where I added the information.

                            Comment

                            • james.cook000@gmail.com
                              Member
                              • Apr 2018
                              • 49

                              #15
                              Hi Jolalla,

                              The other thing that springs to mind is if there are multiple versions of PHP installed perhaps the web server is using php from another path as it may not have been set in the environment or something?

                              Can you run the command 'rpm -qa | grep php' and list the packages...

                              Can you please run and show the results:

                              * /bin/su -s /bin/bash -c 'which php' apache
                              *
                              /bin/su -s /bin/bash -c 'which php' nginx

                              Cheers
                              James

                              Comment

                              Working...