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 TABLE_SCHEMA, TABLE_NAME FROM information_schema.TABLES WHERE ENGINE LIKE 'myisam'; |
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
du -hs /path/to/folder |
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
watch -n1 'mysql --user=user --password=password database --execute="SHOW PROCESSLIST"' |
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
mysql --user=user --password=password -e 'CREATE DATABASE IF NOT EXISTS db_name DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;' |
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
RESET QUERY CACHE; |
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
# Reference: http://webcheatsheet.com/sql/mysql_backup_restore.php | |
# import without compression | |
mysql --host=host --user=user --password=password database < path_to_file.sql | |
# import with compression | |
gunzip < path_to_file.sql.gz | mysql --host=host --user=user --password=password database | |
# export wihtout compression | |
mysqldump --host=host --user=user --password=password database table --where="condition" > path_to_file.sql |
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 `AUTO_INCREMENT` | |
FROM `information_schema`.`TABLES` | |
WHERE `TABLE_SCHEMA` = SCHEMA() | |
AND `TABLE_NAME` = 'tbl_name'; |
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
tac file | grep -m 1 term |
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
# compact | |
tar -zcvf file.tar.gz source-folder | |
# extract | |
tar -zxvf file.tar.gz |
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 table_name,table_schema FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE column_name='column_name'; |
OlderNewer