Is there any way (native MySQL functions or SQL syntax) to encrypt the columns of a table in MySQL database?
2 Answers
MySQL has a wide range of built-in encryption functions, you can find a detailled overview here: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html
You might want to have a look at e.g. AES_DECRYPT() and AES_ENCRYPT().
INSERT INTO table (mycolumn) VALUES(AES_ENCRYPT('Hello!', 'encryption_key'));
SELECT AES_DECRYPT(mycolumn, 'encryption_key') FROM table;