How to get list of users using Drush cli

Please try to use one of the following

drush users:list
drush user-list
drush uinf $(drush sqlq "SELECT GROUP_CONCAT(name) FROM users_field_data")
drush uinf $(drush sqlq "SELECT GROUP_CONCAT(uid) FROM users")
drush uinf $(drush sqlq "SELECT GROUP_CONCAT(name) FROM users")

Don’t forget about mysql prefix if any

cat sites/default/settings.php
Read the rest

How to install multiple Drush versions on the account

It requires a lot of resources, so double check if you have enough

The latest dev version to drush/ folder:

mkdir drush
cd drush
curl -sS https://getcomposer.org/installer | php
./composer.phar require drush/drush:dev-master
cd
echo "alias drush='~/drush/vendor/bin/drush'" >> .bashrc
source .bashrc

Drush 9 version

mkdir drush9
cd drush9
curl -sS https://getcomposer.org/installer
Read the rest

How to install Drupal Console

If you don't have Drush and Composer installed yet, please do it firstly click here

cd
mkdir drupalconsole
cd drupalconsole
curl https://drupalconsole.com/installer -L -o drupal.phar
chmod +x drupal.phar
echo "alias drupal='~/drupalconsole/drupal.phar'" >> ~/.bashrc
source .bashrc

Navigate into your site root where you have Drupal installed

cd /home/$USER/public_html
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader --sort-packages

Check how its working:

drupal site:status
drupal about

Useful URLs:

https://docs.drupalconsole.com/en/getting/composer.htmlRead the rest

How to reset admin password using drush

If you’re on Drupal 7 use https://github.com/drush-ops/drush/archive/7.x.zip to install Drush

drush upwd --password="[email protected]$4401ks" "admin"

MySQL command line:

UPDATE users SET pass = MD5('[email protected]$4401ks') WHERE uid=2;

Drush can generate a one-time login link.

drush uli

Then replace “default” with your website URL

To get URL with your domain name instead of default, try it as the following:

drush uli --uri=yourdomainnamehere.com
Read the rest