Ad Widget

Collapse

Problem with 1.1beta5 images.sql file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dakkonz
    Junior Member
    • Oct 2005
    • 20

    #1

    Problem with 1.1beta5 images.sql file

    Hey guys,
    When i try to dump the data for images.sql i have the following error
    Code:
    ERROR 1048 (23000) at line 24: Column 'image' cannot be null
    The mysql command in images.sql is as follow

    Code:
    insert into images values(1,1,"Hub",load_file("/home/zabbix/zabbix/create/data/images/Hub.png"));
    Can anyone tell me how to solve this?

    Thanks and Regards
    Last edited by dakkonz; 20-01-2006, 10:56.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    I think it is because of lack of read permissions on images files. MySQL user (usually 'mysql') is unable to read them. See ZABBIX Manual for more details.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • dakkonz
      Junior Member
      • Oct 2005
      • 20

      #3
      hmm i have already changed the permission to chmod 444 and
      I have shifted all the images file into /var/tmp/images/
      but when trying to insert the sql commands I still get the error saying that column image cannot be null.
      What is the load_file() function suppose to do? what is the data that is suppose to be stored in that column?

      Sorry i am quite new to zabbix and linux. So not too sure about many things
      thanks and regards

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Move all image files to /tmp and then modify images.sql to have this location in load_file().
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • dakkonz
          Junior Member
          • Oct 2005
          • 20

          #5
          I have moved all the file into /var/tmp/images and have set chmod 777 for them all.

          However i am still getting the same error that the column image cannot be null.
          This is mysql command:
          Code:
          insert into images values(1,1,"Hub",load_file("/var/tmp/images/Hub.png"));
          MySQL is version 5.0.15

          Can anyone tell me how to solve this?

          Thanks and Regards

          Comment

          • Alexei
            Founder, CEO
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2004
            • 5654

            #6
            Are you sure the mysql user can access this directory? Have you tried this?
            Alexei Vladishev
            Creator of Zabbix, Product manager
            New York | Tokyo | Riga
            My Twitter

            Comment

            • dakkonz
              Junior Member
              • Oct 2005
              • 20

              #7
              Haha Solved it already. MySQL user does not have the FILE Privilege.
              Thanks for your help Alexei

              Comment

              Working...