Monday 10 December 2018

RESTful web services mysql-udf-http

wget http://curl.haxx.se/download/curl-7.21.1.tar.gz tar zxvf curl-7.21.1.tar.gz
cd curl-7.21.1/
./configure --prefix=/usr
make && make install
cd ../
echo "/usr/local/webserver/mysql/lib/mysql/" > /etc/ld.so.conf.d/mysql.conf
/sbin/ldconfig
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mysql-udf-http/mysql-udf-http-1.0.tar.gz
tar zxvf mysql-udf-http-1.0.tar.gz
cd mysql-udf-http-1.0/
./configure --prefix=/usr/local/webserver/mysql --with-mysql=/usr/local/webserver/mysql/bin/mysql_config
make && make install
cd ../

2 – Add the UDF in MySQL.
create function http_get returns string soname 'mysql-udf-http.so';
create function http_post returns string soname 'mysql-udf-http.so';
create function http_put returns string soname 'mysql-udf-http.so';
create function http_delete returns string soname 'mysql-udf-http.so';

Thursday 22 February 2018

Rsolved ERROR 1290 (HY000): INTO OUTFILE CSV FILE

Rsolved ERROR 1290 (HY000): INTO OUTFILE CSV FILE
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement


Find out where you are allowed to write

mysql> SELECT @@GLOBAL.secure_file_priv;
+---------------------------+
| @@GLOBAL.secure_file_priv |
+---------------------------+
| NULL                      |
+---------------------------+
1 row in set (0.00 sec)

Enable read/write for MySQL installed

stop mysql Server
vi my.cnf 


[mysqld_safe]
[mysqld]
secure_file_priv="/tmp/"

start mysql

Log in mysql

mysql> SELECT @@GLOBAL.secure_file_priv;
+---------------------------+
| @@GLOBAL.secure_file_priv |
+---------------------------+
| /tmp/          |
+---------------------------+
1 row in set (0.00 sec)


Finally exporting  into a CSV file

mysql> SELECT * FROM testeble INTO OUTFILE '/tmp/test.csv' FIELDS TERMINATED BY ',';
Query OK, 9901 rows affected (1.65 sec)

mysql>

Wednesday 3 January 2018

Solved ERROR 2027 (HY000): Malformed packet

Unable to connect mysql server remotely ,The connection seems OK
it might because of mysql client bug 

You need to update or downgrade the MySQL Client 
You must upgrade the "old_password" hashed password: