myisam_sort_buffer_size used for ALTER TABLE, OPTIMIZE TABLE, REPAIR TABLE commands.
for session
set @@local.myisam_sort_buffer_size=4294967296
Setting innodb_buffer_pool_size
InnoDB optimization basics
http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size
Friday, November 12, 2010
Tuesday, October 26, 2010
Transferring using ssh and pipes.
# no compression, use remote mysqlcommand to run script.
$ mysqldump -u username -p'password' db-name | ssh user@remote.box.com mysql -u username -p'password db-name
# create tarball on remote system
$ sudo tar zcvf - /wwwdata | ssh root@192.168.1.201 "cat > /backup/wwwdata.tar.gz"
# other example from http://blog.gr80.net/post/transfer-your-website-across-servers-using-ssh-tar-mysqldump/
$ sudo
tar -zcf – {local_dir} | ssh {remote_user}@{remote.domain} tar -C {/path/to/remote/dir} -zxf -$ sudo mysqldump -h{local_dbserver} -u{local_dbuser} -p{local_dbpass} {local_dbname} > – | ssh {ssh_username}@{your.domain} mysql -u{remote_dbuser} -p{remote_dbpass} {remote_dbname} < -
Tuesday, October 19, 2010
MySQL temp files in data
Alter table w/ keys disabled creates temp tables w/ names starting w/ #. Copies table to this and then copies over original.
enable keys - no temp files in data while "repair by sorting". Why? done in RAM.
enable keys - no temp files in data while "repair by sorting". Why? done in RAM.
Friday, October 15, 2010
Thursday, October 14, 2010
Verify that a file has constant number of fields.
# awk -F~ '{print NF}' < 20100912PATLAB.txt | sort | uniq
25
add -c to uniq to get count of occurrences.
# awk -F'\t' '{print NF}' < PTINFO.EXT | sort | uniq -c
4420846 38
3 39
3 40
1 41
3 42
25
add -c to uniq to get count of occurrences.
# awk -F'\t' '{print NF}' < PTINFO.EXT | sort | uniq -c
4420846 38
3 39
3 40
1 41
3 42
Compare contents of 2 directories
$ MMM=mydir
$ comm -12 <(ls /usr/local/mypath/$MMM) <(ls ./$MMM)
-1 remove left hand contents
-2 remove common contents
-3 remove right hand contents
$ comm -12 <(ls /usr/local/mypath/$MMM) <(ls ./$MMM)
-1 remove left hand contents
-2 remove common contents
-3 remove right hand contents
Thursday, August 12, 2010
Wednesday, July 28, 2010
Add user to 4.x
INSERT INTO user VALUES('localhost','epictide',PASSWORD('password'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y', '', '', '', '', 0, 0, 0);
Monday, February 22, 2010
RPM remove multiple packages.
[michael@dev-tam-01 ~]$ sudo rpm -e mysql-5.0.77-4.el5_4.1
error: "mysql-5.0.77-4.el5_4.1" specifies multiple packages
[michael@dev-tam-01 ~]$
[michael@dev-tam-01 ~]$ rpm -q --queryformat "%{name}.%{arch}\n" mysql-5.0.77-4.el5_4.1
mysql.x86_64
mysql.i386
[michael@dev-tam-01 ~]$ sudo rpm -e mysql.x86_64
error: "mysql-5.0.77-4.el5_4.1" specifies multiple packages
[michael@dev-tam-01 ~]$
[michael@dev-tam-01 ~]$ rpm -q --queryformat "%{name}.%{arch}\n" mysql-5.0.77-4.el5_4.1
mysql.x86_64
mysql.i386
[michael@dev-tam-01 ~]$ sudo rpm -e mysql.x86_64
Monday, February 1, 2010
Subscribe to:
Posts (Atom)