Last active
August 4, 2016 20:04
-
-
Save progress44/4acb3eaae803a737a699b423644cac3c to your computer and use it in GitHub Desktop.
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 concat('alter table ',table_schema,'.',table_name,' DROP FOREIGN KEY ',constraint_name,';') | |
FROM information_schema.table_constraints | |
WHERE constraint_type='FOREIGN KEY' | |
AND table_schema='cm_demo_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
SHOW ENGINE INNODB STATUS; |
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
-- You must also set innodb_log_file_size to 25% of innodb_buffer_pool_size or 2047M, which ever is smaller. To change the file ib_logfile0 and ib_logfile1, you must: | |
mysql -uroot -p -e"SET GLOBAL innodb_fast_shutdown = 0;" | |
service mysql stop | |
rm ib_logfile0 ib_logfile1 | |
service mysql start |
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 CONCAT(ROUND(KBS/POWER(1024,IF(pw<0,0,IF(pw>3,0,pw)))+0.49999), | |
SUBSTR(' KMG',IF(pw<0,0,IF(pw>3,0,pw))+1,1)) recommended_innodb_buffer_pool_size | |
FROM (SELECT SUM(index_length) KBS FROM information_schema.tables WHERE | |
engine='InnoDB') A,(SELECT 3 pw) B; |
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 CONCAT(ROUND(KBS/POWER(1024,IF(pw<0,0,IF(pw>3,0,pw)))+0.49999), | |
SUBSTR(' KMG',IF(pw<0,0,IF(pw>3,0,pw))+1,1)) recommended_key_buffer_size | |
FROM (SELECT SUM(index_length) KBS FROM information_schema.tables | |
WHERE engine='MyISAM' AND table_schema NOT IN ('information_schema','mysql')) A, | |
(SELECT 3 pw) B; |
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
innodb_read_io_threads=64 | |
innodb_write_io_threads=64 | |
innodb_io_capacity=20000 -- (set this to your device's IOPs) .. actually don't set too high |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your innodb_buffer_pool_size should be set to the amount of InnoDB data and indexes you have. Run this query and it will tell you the Minimum recommended setting for mysql's current Innodb Data
If your InnoDB data far exceeds the installed RAM on the DB server, I recommend 75% of the installed RAM on the box. So, if you have a 16GB server, use 12G as the innodb_buffer_pool_size.
Options Description
for large transaction DB)
Sizes are specified * using K, M, or G suffix letters to indicate units of KB, MB, or GB. Data files must be able to hold your data and indexes total size.