Magento 2 How to reset admin password using CLI / Command Prompt / Terminal in Linux

Let’s see how we can reset Magento 2 admin password in Linux using CLI / command prompt or terminal.

  1. Getting the cryptographic salt
    Magento 2 passwords are stored after scrambling with the cryptographic salt which is defined in the app\etc\env.php
    So first we need to copy that.
    1. open the file app\etc\env.php
    2. Goto crypt section and copy the key value. ( check the image below)
      reset magento-2 admin password
  2. Preparing the SQL
    1. In below sql query,
      1. Replace xxxxxxx with the crypt key from step 1
      2. Replace YourNewPassword with your new password.
      3. Replace admin with your admin username ( if its changed from admin)
      4. if you your magento 2 installation uses a table_prefix , please add that infront ofadmin_user

        UPDATE admin_userSET password = CONCAT(SHA2(‘xxxxxxxYourNewPassword‘, 256), ‘:xxxxxxx:1′) WHERE username = ‘admin‘;
         
  3. Now you have two options to execute this query against your database.
    1. Via CLI/command prompt/terminal
      1. Login to Mysql using the below command
        mysql -u root -p ( enter mysql password when prompted
      2. select your database
        use your_database_name;
      3. Paste the query and press enter
    2. Via PHPMyAdmin
      Paste the query in the PHP myAdmin SQL tab and execute.
  4. Log in to the Magento admin using the new password! that’s it!

[/vc_column_text][/vc_column][/vc_row]

Magento 2 Modes , Set Mode in Magento 2

Display the current mode in Magento 2 using CLI/Command Prompt

bin/magento deploy:mode:show

This will result in something like below

Current application mode: {mode}.

Set/Change mode in Magento 2 using CLI/Command Prompt

bin/magento deploy:mode:set {mode}

{mode} can be either default, developer, or production. If changing to developer mode, out put will be like below

 

Enable or Disable Magento 2 Maintenance Mode using CLI / Command Prompt or Files

What is the magento maintenance mode ?

When Magento is in maintenance mode, visitors see a Service Temporarily Unavailable message in their web browsers instead of the store. However, authorized IP addresses can still view the store normally.

You can enable maintenance mode using two methods.

How to enable magento maintenance mode using cli / command prompt / terminal.

Login to your server using SSH or terminal that is available to you.

change the directory to your Magento store root folder

magento-enable-maintenance-mode-cli-command-prompt

 

 

Then type in the below command and press enter to enable the maintenance mode for everyone.

bin/magento maintenance:enable

enable the maintenance mode for everyone

 

 

 

Now everyone visiting the website will see a Service Temporarily Unavailable message like below.

magento-enable-maintenance-website-viewHow to enable magento maintenance mode for everyone except few IP addresses ( or yourself)

You can also enable the maintenance mode for everyone except a few known IP addresses. This option is useful for fixing a bug on a live website.  Using this method a developer/admin can view the Magento website while other people will see a site under maintenance banner.

1st find out your computers IP address. Easiest way is to go to Chrome and search for “What is my IP address” : click here to search

what-is-my-ip-address-google-searchNow enter below command with your IP address like below .

bin/magento maintenance:enable --ip xxx.xxx.xxx.xxx

The magento website will be now under maintenance mode except for the specified IP.

magento-enable-maintenance-mode-cli-command-prompt-for-specific_ip

 

 

How to disable Magento maintenance mode using CLI / Command Prompt / Terminal

Login to your server using SSH or terminal that is available to you.

change the directory to your Magento store root folder

magento-enable-maintenance-mode-cli-command-prompt

 

 

Then type in the below command and press enter to enable the maintenance mode for everyone.

bin/magento maintenance:disable

 

 

Now the Magento “Service Temporarily Unavailable” message will be gone and the normal website will be shown.

How to enable/disable Magento maintenance mode file “maintenance.flag”

If you dont have access to SSH terminal, still you can enable magento maintenance mode by creating a blank file named “maintenance.flag” under the magento root folder using a FTP client.

To disable magento maintenance mode , delete the file “maintenance.flag” under your magento root folder.

Magento 2 add a user via command line cli

Magento does not allow resetting password of an existing user using the command prompt CLI.

But it allows creating new admin users via CLI.

Login to the command line and change directory to your magento 2 root directory.

e.g. cd  /var/www/magento2

Enter the below command and press enter.

php bin/magento admin:user:create

The CLI will prompt for username, password, email address, first name and last name for the user being created.

Latest Magento 2 Project : BuyFresh.lk is Live

BuyFresh.lk  – Magento powered Ecommerce Website Launched

BuyFresh brings organic & semi-organic produce from the central highlands of Sri Lanka via there brand-new ecommerce website www.buyfresh.lk

Designed and developed by Mobiz Int, Buyfresh.lk features many advanced ecommerce features powered with Magento software platform.

BuyFresh.lk offers many payment options and shipping methods to their customers . They currently offer their services to the greater Colombo area and suburbs with plans to expand to more territories.

Be sure to check out and order some great tasting fresh vegetables and seafood from BuyFresh.lk

Adobe to Marry Magento, A match made in heaven ? Our take on Adobe”s acquisition of Magento Commerce

magento website

Mark Lavelle, CEO, Magento Commerce announced that Adobe has announced their interest to buy Magento in a blog post.

He wrote “I am excited to share some BIG news. Today, Adobe announced their intent to acquire Magento! This marks the next step in our journey to drive innovation across every facet of commerce.”

TechCrunch, the popular tech blog thinks this should  help Adobe compete with Salesforce, which offers its own marketing, sales and service offerings in the cloud and which bought Demandware for more than $2 billion in 2016 to provide a similar set of functionality.

We as leading Magento Developers from Sri Lanka are all excited about this merger of two giants that we work everyday with. We use Adobe software to design and develop Magento websites. Thats why we feel this union is one made is heaven ! 🙂

More reads about Adobe’s Magento acquisition. 

https://magento.com/blog/magento-news/adobe-to-acquire-magento

http://www.businessinsider.com/wall-street-reaction-adobe-magento-deal-2018-5

https://magento.com/blog/magento-news/adobe-to-acquire-magento

 

magento web development sri lanka
  1. In Magento Admin Panel and navigate to System > Configuration
    magento_rss_enable_menu
  2. Rss Config section set Enable RSS to ‘Enable’.
  3. In the Catalog section set required feeds to ‘Enable’. An experienced Magento Developer may know what needs to be activated.
    • New Products. This RSS feed tracks new products added to the store catalog.
    • Special Products. This RSS feed will syndicate products with special pricing.
    • Coupons/Discounts. Any special coupons or discounts in your store will be added to this RSS feed.
    • Tags Products. The tags products RSS feed manages and syndicates newly added product tags.
    • Top Level Category. This RSS feed tracks new top level categories or root level categories in your catalog.
  4.  Press Save Config
  5. To see the RSS feeds activated add ‘/rss’ after your site URL, f.e. ‘http://yourdomainname.com/rss’: