There is a function in Mysql AES_encrypt.
SELECT AES_encrypt( \"Hello World\", \"password\" ) AS encrypted_value
This gives the result:
The MySQL AES_encrypt uses a 128-bit key length - Reference here
Whereas your PHP code uses 256-bit key lengths.
To fix the problem you should be able to uses 'MCRYPT_RIJNDAEL_128' instead of 256.