Skip to content

Instantly share code, notes, and snippets.

@niedbalski
Created September 16, 2020 21:38
Show Gist options
  • Save niedbalski/f432950563b6a150986b37900b980243 to your computer and use it in GitHub Desktop.
Save niedbalski/f432950563b6a150986b37900b980243 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
time mysql -ukeystone_admin -pYourPassHERE -hYourHostHERE <<EOF
use keystone;
drop table if exists temp_tokens;
create table temp_tokens
as (select * from token where expires >= NOW());
select count(*) from temp_tokens;
truncate table token;
insert into token select * from temp_tokens;
drop table temp_tokens;
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment