Cannot retrieve resultset data
The main issue you are seeing is based on the nature of the encryption.  The Delphi application appears to not be using any native MySQL encryption/decryption mechanisms for the data.  This will result in certain disadvantages when querying for data.  Although the decrypted data is visible to the application while in use, native to MySQL, it has no what of indexing any encrypted data fields in any optimized way as the values would be unknown.  This would result in long query times as most likely all queries would be scanning the whole table to deliver any results.

If you can, use the Delphi application, or similarly developed application to export the data unencrypted into a file, easily parsed by MySQL (csv, SQL statements, etc.) that can be imported into your MySQL 5.7 database instance.  

This will allow you to create indexes on the unencrypted data to run your queries as necessary.

If you need to reencrypt the data, you can use the native functions of MySQL:

https://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html

However, you will still be unable to index those columns in any workable way to query on those columns.  I would recommend if possible that any queries be done on any columns that can remain unencrypted and therefore be indexed accordingly to optimize the execution plans.