Door clemens op do, 2011/01/13 - 11:06am
I want to run svn up on the site but I need to offline it first. So who is online?
SELECT name, mail, (unix_timestamp()-access)/3600 AS hours
FROM users
HAVING hours < 1
ORDER BY access;
Or for short
drush sql-query "select name, mail, (unix_timestamp()-access)/3600 as hours from users having hours < 1 order by access;"
Door clemens op di, 2011/01/11 - 8:56am
(this is my scratchpad)
I installed mysql on a mac straight from mysql website. Not sure whether that was a wise decision.
Door clemens op do, 2010/05/20 - 12:46pm
I want a clean database without clicking.
echo "\
SELECT concat('drop table ', table_name, ';') \
FROM information_schema.tables \
WHERE table_schema=schema()" \
| `drush sql-connect` \
| grep "^drop table " \
| `drush sql-connect`
This work only for single drupal / single schema installs.
Door clemens op ma, 2008/03/03 - 12:18pm
I still forget how to do the database and user creation and drop goes. So why not make a note.
Creating
create database test;
create user 'test' identified by 'pwtest';
grant all on test.* to 'test'@'localhost' identified by 'pwtest';
Cleaning up
drop user test;
drop database;
Yeah ... call me stupid ;-)