MySQL

MySQL Events

Display events – select database show events Dispaly events from information schema select * from information_schema.events Disable/Enable event ALTER EVENT myevent DISABLE; ALTER EVENT myevent ENABLE; https://dev.mysql.com/doc/refman/5.7/en/show-events.htmlhttps://dev.mysql.com/doc/refman/8.0/en/alter-event.html

MySQL Config Editor

Use MySQL Config editor to save your login cridential and use it in any scripting. Create login-path mysql_config_editor set –login-path=LOGIN-PATH-NAME–user=USERNAME–socket=/tmp/mysql3340.sock -p mysql_config_editor set –login-path=LOGIN-PATH-NAME–user=USERNAME–host=HOSTNAME –port=PORT -p

Get autoincremental value

Get autoincremental value SHOW TABLE STATUS FROM `DatabaseName` WHERE `name` LIKE ‘TableName’ ; Query from information schema SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘DatabaseName’ AND TABLE_NAME = ‘TableName’; Change auto_incremental value ALTER TABLE table AUTO_INCREMENT = n;

MySQL replication

MySQL replication with binlog update. We have two MySQL cluster Cluster 1 Cluster 2 Cluster 1 is a master for Cluster 2 then from Cluster 2 we replicate to MySQL Enterprise. Application is connected to cluster 1 In application we are Read More