cd /usr/local/src/
git clone https://github.com/netkiller/mysql-image-plugin.git
cd mysql-image-plugin/
yum install cmake
cmake .
make && make install
or
gcc -O3 -g -I/usr/include/mysql -I/usr/include/sys -fPIC -shared -o libimage.so image.c
sudo mv libimage.so /usr/lib/mysql/plugin/
mysql> create function image_check returns string soname 'libimage.so';
Query OK, 0 rows affected (0.44 sec)
mysql> select image_check('/www/images/logo.png');
create function image_check returns string soname 'libimage.so';
create function image_remove returns string soname 'libimage.so';
create function image_rename returns string soname 'libimage.so';
create function image_crc32 returns string soname 'libimage.so';
create function image_move returns string soname 'libimage.so';
drop function image_check;
drop function image_remove;
drop function image_rename;
drop function image_crc32;
drop function image_move;
select image_check('/path/filename.ext');
select image_remove('/path/filename.ext');
select image_rename('/path/oldfile.ext','/path/newfile.ext');
select image_crc32('/path/filename.ext');
select image_move('/path/filename.ext','/path/to/newfile.ext');
We accept PayPal through:
https://www.paypal.me/netkiller
Wechat (微信) / Alipay (支付宝) 打赏: