Skip to content

Instantly share code, notes, and snippets.

@andrescevp
Last active September 27, 2017 07:42
Show Gist options
  • Save andrescevp/0ee550619254a4f22155d6c48e0dbe27 to your computer and use it in GitHub Desktop.
Save andrescevp/0ee550619254a4f22155d6c48e0dbe27 to your computer and use it in GitHub Desktop.
MySQL Cheat Querys
SET FOREIGN_KEY_CHECKS=0; #disable
SET FOREIGN_KEY_CHECKS=1; #enable
mysqldump --opt --single-transaction --no-data --disable-keys -u <user> -h <host> -p DB
select * from information_schema.columns
where table_schema = 'db' AND
COLUMN_NAME like '%foo%'
#AND TABLE_NAME like '%foo%'
order by table_name,ordinal_position;
SELECT * FROM news WHERE date >= now() - INTERVAL 1 DAY;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment