Tuesday, May 14, 2013

Migrate mysql users to another server

ERROR 1577 (HY000) at line 1: Cannot proceed because system tables used by Event Scheduler were found damaged at server start ERROR 1547 (HY000) at line 1: Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted


solution:
sudo mysql_upgrade -uroot -p --force

Rsync and sudo over SSH

backup_user ALL=(root)NOPASSWD:/usr/bin/rsync

rsync --rsync-path="sudo rsync" backup_user@myhosttobackup.net:/root /backup_directory

debian Add a second hard disk

fdisk -l

cfdisk /dev/sdb

mkfs.ext3 /dev/sdb1

mkdir /disk2
mount -t ext3 /dev/sdb1 /disk2

/etc/fstab
/dev/sdb1 /disk2 ext3 defaults,errors=remount-ro 0 1 

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

in my case
my solution is simply comment out skip-bdb
Berkeley DB is no longer in 5.1x, so the option doesn't apply any more

Sunday, April 21, 2013

debian no sound

lsof /dev/snd/*

to find out what program are using sound device, some program might be hanging causing sound not to function

Wednesday, April 10, 2013

linux grep and sed to find through files and replace a string

grep -rl oldstring path | xargs sed -i 's/oldstring/newstring/g

find /path -type f -exec sed -i 's/oldstring/newstring/g' {} \;

Friday, April 5, 2013