You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SET foreign_key_checks = 0;
SET foreign_key_checks = 1;
Reset auto increment
ALTER TABLE `table_name` AUTO_INCREMENT = 1;
Concatenate (non NULL) values from a group
SELECT `movie`, GROUP_CONCAT(`time` SEPARATOR ',') AS `running_times` FROM `schedule` WHERE `movie` = 'A Beautiful Mind' GROUP BY `movie` ORDER BY NULL
Search & Replace Data
UPDATE `table_name` SET `field_name` = REPLACE(`field_name`, 'string_to_find', 'string_to_replace');
Troubleshooting
SHOW ENGINE INNODB STATUS
Disable cache
SELECT SQL_NO_CACHE ...; (per query)
SET SESSION query_cache_type=0/1/2; (per session, use 0 to turn OFF, 1 to turn ON)
SHOW VARIABLES LIKE 'query_cache_size';
SET GLOBAL query_cache_size=0 (globally)
SET GLOBAL query_cache_size=<old_value>