This code could help you, just change mysite.com and www.mysite.com and go to phpMyadmin run that Sql code:
UPDATE wp_comments SET comment_author_url = REPLACE(comment_author_url, 'mysite.com', 'www.mysite.com');
UPDATE wp_options SET option_value = REPLACE(option_value, 'mysite.com', 'www.mysite.com');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'mysite.com', 'www.mysite.com');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'mysite.com', 'www.mysite.com');
UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, 'mysite.com', 'www.mysite.com');
UPDATE wp_posts SET guid = REPLACE(guid, 'mysite.com', 'www.mysite.com');
UPDATE wp_usermeta SET meta_value = REPLACE(meta_value, 'mysite.com', 'www.mysite.com');
UPDATE wp_users SET user_email = REPLACE(user_email, 'mysite.com', 'www.mysite.com');
UPDATE wp_users SET user_url = REPLACE(user_url, 'mysite.com', 'www.mysite.com');
OR
You can use that simple tool it will generate it for you. If you are using different Table Prefix just change wp_
with your table prefix.