yum -y install http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum repolist all | grep mysql
yum -y install mysql-community-server
service mysqld start
Note that you could runn the command "mysql_secure_installation" to do all of the following for you. However, it appears to require user interaction so it does not work for a fully scriptable setup (making it unnacceptable for our use case).
Instead, run:
mysqladmin -u root password __YOUR_NEW_PASSWORD_HERE__
Then login to mysql using:
mysql -u root -p
And enter your password when prompted. Then run the following MySQL commands to make your database more secure:
SELECT * FROM mysql.user;
DELETE FROM mysql.user WHERE user='';
DELETE FROM mysql.user WHERE user='root' AND host NOT IN ('localhost', '127.0.0.1', '::1');
DROP DATABASE test;
exit;
Edit php.ini:
vi /usr/local/php/lib/php.ini
And make sure all MySQL sockets are set to the proper value:
pdo_mysql.default_socket= /var/lib/mysql/mysql.sock
Note: the above step should be replaced by pulling a pre-built php.ini.
Then restart Apache to take new PHP changes into effect.
service httpd restart