mysql-udf-base64 icon indicating copy to clipboard operation
mysql-udf-base64 copied to clipboard

ERROR 2013 (HY000): Lost connection to MySQL server during query

Open bguruprasad opened this issue 8 years ago • 4 comments

Hi, This function works pretty fine when used on small dataset, < 5 records. When used on large dataset it gives ERROR 2013 (HY000): Lost connection to MySQL server during query I want to use it on more then 1000 rows, how to archive the same? It is even possible or not???

bguruprasad avatar Dec 02 '16 12:12 bguruprasad

Hi. I thought some types of record cause the error. it might not be dataset size. Would you try to find the record which is the trigger. Anyway, It seems this UDF needs some error handling.

y-ken avatar Dec 02 '16 23:12 y-ken

@y-ken, I have inserted same records multiple times to test this UDF, but still it is giving same error.

bguruprasad avatar Dec 05 '16 08:12 bguruprasad

Hi

If you're using MySQL 5.6.1 or higher you can use the TO_BASE64 / FROM_BASE64() function. https://dev.mysql.com/doc/refman/5.6/en/string-functions.html#function_from-base64

-- note: This function was added in MySQL 5.6.1.
mysql> SELECT TO_BASE64('base64 encoded string');
-> YmFzZTY0IGVuY29kZWQgc3RyaW5n

y-ken avatar Dec 05 '16 08:12 y-ken

Yes, I'm aware of this new string function available in MySQL v5.6 above, I have MySQL v5.5 in production and want to use this UDF for my propose. :)

bguruprasad avatar Dec 05 '16 08:12 bguruprasad