Tuesday, August 16, 2011

On setting up database for Facebook assignment


I’m not sure this is allowed(?), but after spending quite some time setting up the database to run on AWS, I think I will document it a bit here, for me if I get trouble on this later (and maybe for later CS3216 batch too?)
Assumption: you had an AWS EC2 running instance and you can SSH in.
First, make sure you have installed MySQL server. If not, use yum install mysql-server
Then following these steps:
1. Configure MySQL to start on startup
ntsysv
check "mysqld"
2. Start up MySQL
/etc/init.d/mysqld start
3. Set root password
mysqladmin -u root password new-password-here
If you got problem on this, saying
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

then continue from step 4, else you can continue from step 5
4. We need to resetting the mysql root password.
First we need to stop mysql:
Now to start mysql using –skip-grant-tables:
 

NOTE: Remember the ‘&’ at the end of the line as this will start the process in the background. Also take note of the PID (process id) highlighted in red – we’ll need this later
So far, so good. Lets login to mysql so we can change the password:
Now to change that password:
With that out of the way, we still need to kill the mysqld_safe instance of mysql we started earlier:
Great! Lets start mysql again and see if we can login:
That’s it for resetting the password.
5. From here you can use access the database on your server normally =). Hope it helps.

Reference:
http://goscalable.com/category/cloud/aws/



No comments:

Post a Comment