Here is simple command which you can run on your ec2 instance using putty.
Step 1. Login to instance using putty.
Step 2. Before typing bellow command take backup of your database so you can export it again after upgrade.
Step 3. Type below command
sudo apt-get update sudo apt-get upgrade sudo apt-get install mysql-server-5.6
Once upgrade is complete restart your server.
Step 4. Server restart
sudo service apache2 restart
All done.