Category mysql

Mysql: remove binlogs and set expare_logs_days

shell> mysql -u username -p mysql> PURGE BINARY LOGS TO ‘mysql-bin.000015’; Alternatively, you can remove the binary older than a specific date. shell> mysql -u username -p mysql> PURGE BINARY LOGS BEFORE ‘2009-11-01 00:00:00’; expare_logs_days  = 10 mysql> show variables…

MySQL: slow_query_log without restart

mysql> pager less; PAGER set to ‘less’   Выводим информацию о текущих установках глобальных переменных: mysql> SHOW VARIABLES; | slow_query_log | OFF | | slow_query_log_file |   Включаем ведение лога: mysql> set global log_slow_queries=’ON’; Query OK, 0 rows affected,…

Rsync corruption innodb

I skimmed over this thread and I think I can help clarify the innodb, rsync, and lvm situation. The basic issue with just running rsync on the files under a running mysqld is that the rsync will copy different parts…

MySQL Innodb Backup

1. Download and install the latest version #For Debian wget deb/squeeze/x86_64/percona-xtrabackup_2.0.6-521.squeeze_amd64.deb dpkg -i percona-xtrabackup_2.0.6-521.squeeze_amd64.deb #For RedHat wget RPM/rhel6/x86_64/percona-xtrabackup-2.0.6-521.rhel6.x86_64.rpm yum install percona-xtrabackup-2.0.6-521.rhel6.x86_64.rpm innobackupex –user=DBUSER –password=DBUSERPASS ${/path_to/BACKUP-DIR} $ gpg –keyserver –recv-keys 1C4CBDCDCD2EFD2A … [some output removed] … gpg: imported: 1…

Mysql Commands

Show process list: SHOW PROCESSLIST; asd  Properties of Transactions: Transactions have the following four standard properties, usually referred to by the acronym ACID: Atomicity: ensures that all operations within the work unit are completed successfully; otherwise, the transaction is aborted…

Drop Multiple Tables

mysql> SHOW TABLES LIKE “phpbb_%”; /* list all phpBB tables */ mysql> DROP TABLES LIKE “phpbb_%”; /* DROP THEM? Quite a naive approach.. */

Mysql my.cnf :: some notes

For successful backup the packet size must be the same [mysqld] key_buffer                                      = 160M max_allowed_packet                      = 150M [mysqldump] quick max_allowed_packet                      = 160M