Syntax:
ENCODE(str,pass_str)

ENCODE() encrypts str using pass_str as the password. The result is a
binary string of the same length as str. To decrypt the result, use
DECODE().

*Note*:

The ENCODE() and DECODE() functions are deprecated in MySQL 5.7, and
should no longer be used. Expect them to be removed in a future MySQL
release.

If you still need to use ENCODE(), a salt value must be used with it to
reduce risk. For example:

ENCODE('cleartext', CONCAT('my_random_salt','my_secret_password'))

A new random salt value must be used whenever a password is updated.

If ENCODE() is invoked from within the mysql client, binary strings
display using hexadecimal notation, depending on the value of the
--binary-as-hex. For more information about that option, see
https://dev.mysql.com/doc/refman/5.7/en/mysql.html.

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

