Command Line DB changes

I recently came across a reason to know how to alter the database using command line

  1. Log into the client’s server using terminal.
  2. Gain access to MySQL using m or mysql -u root -p.
  3. Access their database using: use database ;

where database is the database name.

  1. Run the following command:  select * from core_config_data where path like ‘%base%url%’;
  2. This will display the current base_urls set in magento.
  3. To change the base URLs run:
update core_config_data set value = 'http://domainname/' where path = 'web/unsecure/base_url';
update core_config_data set value = 'http://domainname/' where path = 'web/secure/base_url';

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.