This tutorial explains how to use the MySQL ENCRYPT function with syntax and examples.
The MySQL ENCRYPT function is used to encrypt a string using UNIX crypt().
The syntax for the ENCRYPT function in MySQL is:
The plaintext string that is encrypted using UNIX crypt().
Optional. The string that is at least 2 characters long that is used in the encryption process. If salt is not provided, the ENCRYPT function will use a random value.
The ENCRYPT function can be used in the following versions of MySQL:
Let's look at some MySQL ENCRYPT function examples and explore how to use the ENCRYPT function in MySQL.
For example: