Amazon Web Services has a great tutorial on how to get MySQL up and running on their persistent storage solution, Elastic Block Store. If you did follow this tutorial on a Fedora instance, however, you may have invalidated your MySQL client config and your PHP configuration.

In the case of the MySQL client, you may observe the following error when trying to access MySQL from the command line:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

The cause is that everything in /var/lib/mysql was moved to /vol/lib/mysql in the tutorial, including the socket for the client to connect to, so this is easily remedied by adding the following to /etc/my.cnf:

[client]
/vol/lib/mysql/mysql.sock

In the case of PHP, you may find that connections can no longer be made to MySQL for the same reason. Simply ensure that the following is set in /etc/php.ini:

mysql.default_socket = /vol/lib/mysql/mysql.sock

Your HTTP daemon will now need to be restarted.

Another option later suggested in the article would involve using symbolic links from the old locations to new ones.

Written on January 28th, 2009 , All, Amazon Web Services, Dev & Test, Tech

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

COMMENTS

    [...] This post was mentioned on Twitter by junichi_y, junichi_y. junichi_y said: AWS Elastic Block Store + MySQL Tutorial | richardrauser.com: http://bit.ly/e8fQg7 [...]

    February 13, 2011 at 7:08 am

richardrauser.com is proudly powered by WordPress and the Theme Adventure by Eric Schwarz
Entries (RSS) and Comments (RSS).

richardrauser.com