I'm trying to install the latest beta of Zabbix and can't install the images.sql rows. I keep getting errors with that load_file string function with mysql as it always returns null no matter what I do. Here's the description in mysql docs:
LOAD_FILE(file_name)
Reads the file and returns the file contents as a string. The file must be located on the server, you must specify the full pathname to the file, and you must have the FILE privilege. The file must be readable by all and be smaller than max_allowed_packet bytes.
If the file doesn't exist or cannot be read because one of the preceding conditions is not satisfied, the function returns NULL.
zabbixdbuser (my mysql user) has File_priv = 'Y':
mysql> select * from user where User='zabbixdbuser';
+-----------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv |
+-----------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
| localhost | zabbixdbuser | 4b81fbf24265bc39 | N | N | N | N | N | N | N | N | N | Y | N | N | N | N |
+-----------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
1 row in set (0.00 sec)
I don't know how to check the size of "max_allowed_packet", but the default is supposed to be 1mbyte and I never changed that.
mysql> insert into images values(1,1,"Hub",load_file("/home/zabbix/zabbix/create/data/images/Hub.png"));
ERROR 1048: Column 'image' cannot be null
mysql> \q
Bye
[zabbix@manager data]$ ls -lh /home/zabbix/zabbix/create/data/images/Hub.png
-rw-r--r-- 1 zabbix zabbix 1.9K Jul 29 2004 /home/zabbix/zabbix/create/data/images/Hub.png
Oh and my mysql version is 3.23.58.
LOAD_FILE(file_name)
Reads the file and returns the file contents as a string. The file must be located on the server, you must specify the full pathname to the file, and you must have the FILE privilege. The file must be readable by all and be smaller than max_allowed_packet bytes.
If the file doesn't exist or cannot be read because one of the preceding conditions is not satisfied, the function returns NULL.
zabbixdbuser (my mysql user) has File_priv = 'Y':
mysql> select * from user where User='zabbixdbuser';
+-----------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv |
+-----------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
| localhost | zabbixdbuser | 4b81fbf24265bc39 | N | N | N | N | N | N | N | N | N | Y | N | N | N | N |
+-----------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+
1 row in set (0.00 sec)
I don't know how to check the size of "max_allowed_packet", but the default is supposed to be 1mbyte and I never changed that.
mysql> insert into images values(1,1,"Hub",load_file("/home/zabbix/zabbix/create/data/images/Hub.png"));
ERROR 1048: Column 'image' cannot be null
mysql> \q
Bye
[zabbix@manager data]$ ls -lh /home/zabbix/zabbix/create/data/images/Hub.png
-rw-r--r-- 1 zabbix zabbix 1.9K Jul 29 2004 /home/zabbix/zabbix/create/data/images/Hub.png
Oh and my mysql version is 3.23.58.


Comment