Drush

User login

Create a new administrator account in drupal with drush

In otder to create a new user in your website using drush, you'll need to run the following commands:

$ drush user-create YourUsername --mail="your@mail.com" --password="YourPassword"

This will create a new user in the website.

In order to assign the role administrator to the user run:

$ drush user-add-role "administrator" YourUsername

Drush - Short Tips

Quick notes on Drush, while on a Drupal installation folder:

To create an archive of the current Drupal site:
drush archive-dump --destination=/backups/mysite.tar

To restore the files and databases for all sites in the archive.
drush archive-restore /backups/mysite.tar

To create a mysql dump of the current Drupal database:
drush sql-dump --result-file=
/mydb.sql

To drop all tables of the current Drupal database:
drush sql-drop

To import a new db file in the current Drupal database:

PHP Fatal error: Class 'Console_Table' not found in... drush error

After a fresh drush installation, drush status returned this error message:

[konordo@konordo ~]# drush status
<strong>PHP Fatal error:  Class 'Console_Table' not found in drush/path/drush.inc on line 955 </strong>

The solution was to install the php pear extension

Subscribe to Drush