Tuesday 11 March 2014

MY SQL - Magento Base URL

I accidentally changed the "default store views" base URL's thinking I was on another store view.
To correct this I did the following:

Areas in red are the commands to add to mysql via putty - see other posts regarding putty logging in ect here http://nginxputtymagento.blogspot.co.uk/

1) Log into Putty using the Root login

2) open MySql with the command: mysql

3) use magentodatabasename; - > you need to type the word "use" followed by your data base name - this can be located in the config file under you SSH/FTP in the location: app/ect/config.xml - this will show you your data base name, user name and pass word.
so you need to type the word use followed by the data base name followed by a semi colon ; see below. (swap your databasename with your actual database name)
use yourdatabasename;

4) add the full line to putty below:
select * from core_config_data where path like '%base%url%';

5) Use the full command below - only changing the url i.e. http://yourdomaingoeshere/
add line
update core_config_data set value = 'http://somedomainname/' where path = 'web/unsecure/base_url';


6) do the same as above with the line below and add - again you need to change the url to your own!
update core_config_data set value = 'http://somedomainname/' where path = 'web/secure/base_url';

7) this is now done, your website should now work from the domain/url you added in to the two lines of code above.

trouble shooting -
* check the data base name in step 1
* check you used semi colons at the end of step 1 and the word "use" (with out brackets)
* check the url added in lines 5 and 6 you should have changed these to your own website address
* clear your cache - when I do this I always download it first as a back up it is found in your var/cache folder
you need to delete all folders within the folder cache. - remember to back up first!

your site should now open at the requested url.

No comments:

Post a Comment