##Tutorial for MySQL Replication over SSL (one-way)## ##################################################### ##Check that SSL has been compiled in SSL on both the master and the client: SHOW VARIABLES LIKE ‘have_openssl'; or mysql –ssl –help If it says disabled or yes then its fine. If it says no then an SSL enabled version of MySQL needs to be installed. […]
Archive for December, 2009
MySQL repair corruption
for db: mysqlcheck -uadmin -p$(cat /etc/psa/.psa.shadow ) –databases databasename –repair for table: check table tablename; repair table tablename; repair can lose data so a restore from backup may be necessary.
MySQL Log slow queries
edit /etc/my.cnf: log-slow-queries=/var/log/mysql-slow.log set-variable=long_query_time=6 restart mysqld
MySQL Log queries not using indexes
# Edit /etc/my.cnf log-queries-not-using-indexes = /var/log/mysql-indexes.log
MySQL set Fulltext Min_Word_Len
add the following to my.cnf under [mysqld] ft_min_word_len=2 stop mysql myisamchk –recover –ft_min_word_len=2 /var/lib/mysql/*/*.MYI start mysql
MySQL Dump database to Email
To backup a database and send it to email, add a cron job like: mysqldump -ce –user=user –password=pass dbname | gzip |uuencode dbbackup.gz| mail -s “xxxx Database Backup” me@mydomain.com
MSSQL Express Scheduled Backups
The Express edition of SQL server lacks automated scheduled backup functionality. The following script will back up your databases. It retains them for 7 days but can be easily edited: Create a directory called c:\SQLBackup and go into it Create a backup.sql file: DECLARE @name VARCHAR(50) — database name DECLARE @path VARCHAR(256) — path for […]
Mailman reset password
Reset a mailing list password in Mailman: /usr/lib/mailman/bin/change_pw -d mydomain.com -ptemppass
Linux reset root password
A Linux servers root password can be reset in a few simple steps via single-user mode. To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following: 1. At the boot loader menu, use the arrow keys to highlight the installation […]
Linux / nix Error Codes
Not comprehensive, but comes in handy: * EPERM 1 /* Operation not permitted */ (Linux) * EPERM 1 /* Not owner */ (SCO Unix) * ENOENT 2 /* No such file or directory */ * ESRCH 3 /* No such process */ * EINTR 4 /* Interrupted system call */ * EIO 5 /* I/O […]