The current installation of mysql is 5.5.30 and it is in Amazon ec2 I want to upgrade it to 5.6.21
sudo apt-get install mysql-server=5.6.21
But it says:
Version '5.6.21' for 'mysql-server' was not found
I would suspect version 5.6.21 just isn't offered in your distro's package manager.
You should be able to check which version(s) are reported as available if you run
apt-cache policy mysql-server.
i.e.: here's the current output I get from Debian Wheezy:
$ sudo apt-cache policy mysql-server mysql-server: Installed: (none) Candidate: 5.5.41-0+wheezy1 Version table: 5.5.41-0+wheezy1 0 500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
So 5.5.41 is the current version offered through the package manager.