Last active
September 27, 2017 07:42
-
-
Save andrescevp/0ee550619254a4f22155d6c48e0dbe27 to your computer and use it in GitHub Desktop.
MySQL Cheat Querys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS=0; #disable | |
SET FOREIGN_KEY_CHECKS=1; #enable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump --opt --single-transaction --no-data --disable-keys -u <user> -h <host> -p DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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