The 504 error from phpmyadmin tells me that you have a configuration problem that has nothing to do with WP. My guess is either a problem with the database configuration or (more likely) a configuration with your web server.
I use this script to print out web server information. Create a file and put somewhere on the webserver then call it from your browser:
<?php
echo phpinfo();
?>
My guess is that your php memory_limit is too low. There are plugins that check for some of the php config, but I do not remember them off hand right now.