Did you accidentally change the wordpress site and home url and now cannot access the site.

Well there are a number of scripts that can reset those options and are openly available, but i will be discussing how to directly reset those option in the mysql database and also by this method you can change any wordpress option easily and fastly.

Following are the steps to reset the siteurl and home :

1. Login to mysql wordpress database(i.e the database that you made for wordpress) using your user name and password.

2.Then type the following command to view the siteurl and home page that you setup incorrectly:
SELECT *FROM wp_options where option_name='siteurl' or option_name='home';

3. Having seen what you have entered incorrectly type the following command ( i am assuming your site and home url to be abc.com replace with your own sitename and home page url).

a) //this resets the home url to abc.com
update wp_options set option_value='http://abc.com' where option_name='home'

b)
//this resets siteurl to abc.com
update wp_options set option_value='http://abc.com' where option_name='siteurl'


4.This resets the site url and home page url you can view the changes by executing the command aforementioned in the second step.

Note: This process can me made even more naive if you have mysql query browser which is a Gui based utility where by you can directly edit the options without executing a single command (it will do so on its own).