getting this error: PDOException: SQLSTATE[23000]
I resolved this by truncating all the caching tables using mysql query.
I followed following steps:

1. Connect Sql server 
2. Truncate the all the cache tables and they are as follows:
truncate cache;
truncate cache_admin_menu;
truncate cache_block;
truncate cache_bootstrap;
truncate cache_field;
truncate cache_filter;
truncate cache_form;
truncate cache_image;
truncate cache_libraries;
truncate cache_media_xml;
truncate cache_menu;
truncate cache_page;
truncate cache_path;
truncate cache_token;
truncate cache_views;
truncate cache_views_data;


By doing this above steps I can able to resolve this issue.