国产一区二区三区四区五区3d ,日本成人黄色,av在线1区2区http://www.aygfsteel.com/miaoyachun/category/50698.htmlzh-cnWed, 04 Jul 2012 07:07:42 GMTWed, 04 Jul 2012 07:07:42 GMT60SQL連接查詢http://www.aygfsteel.com/miaoyachun/archive/2012/07/04/382161.htmlMilo的海域Milo的海域Wed, 04 Jul 2012 01:35:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/07/04/382161.htmlhttp://www.aygfsteel.com/miaoyachun/comments/382161.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/07/04/382161.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/382161.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/382161.htmlSQL連接查詢

]]>
About cannot core dump after setuid on linux serverhttp://www.aygfsteel.com/miaoyachun/archive/2012/05/30/379560.htmlMilo的海域Milo的海域Wed, 30 May 2012 07:32:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/05/30/379560.htmlhttp://www.aygfsteel.com/miaoyachun/comments/379560.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/05/30/379560.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/379560.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/379560.html
In many cases, binaries can no longer dump core after calling setuid(). 
Under Linux it is possible to re-enable this with a system call.

e.g.

+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
+
 #ifdef HAVE_purify
 
#define IF_PURIFY(A,B) (A)
 
#else
@@ 
-1362,6 +1366,10 @@
     sql_perror(
"setuid");
     unireg_abort(
1);
   }
+#ifdef __linux__
+  /* inform kernel that process is dumpable */
+  prctl(PR_SET_DUMPABLE,1,0,0,0);
+#endif /* __linux__ */
 
#endif
Manual of prctl
       PR_SET_DUMPABLE
              (Since Linux 
2.4) Set the state of the flag determining whether core dumps are produced for this process  upon  delivery  of  a
              signal  whose  default  behaviour  is  to  produce a core dump.  (Normally this flag is set for a process by default
, but it is
              cleared when a set-user-ID or set-group-ID program is executed and also by various system calls that  manipulate  process  UIDs
              and  GIDs).  In kernels up to and including 
2.6.12, arg2 must be either 0 (process is not dumpable) or 1 (process is dumpable).
              Since kernel 
2.6.13, the value 2 is also permitted; this causes any binary which normally would not  be  dumped  to  be  dumped
              readable by root only.  (See also the description of /proc/sys/fs/suid_dumpable in proc(5).)


Ref: http://bugs.mysql.com/bug.php?id=21723
Some files about linux core dump:
/proc/sys/fs/suid_dumpable
/etc/profile
/etc/security/limits.conf
/proc/sys/kernel/core_pattern



]]>
sysbench 0.5介紹http://www.aygfsteel.com/miaoyachun/archive/2012/05/14/378114.htmlMilo的海域Milo的海域Mon, 14 May 2012 08:10:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/05/14/378114.htmlhttp://www.aygfsteel.com/miaoyachun/comments/378114.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/05/14/378114.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/378114.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/378114.html
Download src code
bzr branch lp:sysbench

make后就可以執(zhí)行了

Percona對(duì)這個(gè)版本的sysbench的參數(shù)有個(gè)不錯(cuò)的wiki page:
http://www.percona.com/docs/wiki/benchmark:sysbench:olpt.lua

下面這個(gè)文章對(duì)0.5的sysbench有個(gè)比較全面的介紹:
./sysbench --mysql-host=$host1 --mysql-port=3306 --mysql-user=*** --mysql-password=*** --test=/path/to/sysbench/tests/db/oltp.lua --oltp-tables-count=$oltp_table_num --num-threads=$num_thread --max-requests=0 --max-time=$max_time prepare

./sysbench --mysql-host
=$host1 --mysql-port=3306 --mysql-user=*** --mysql-password=*** --test=/path/to/sysbench/tests/db/oltp.lua --oltp-tables-count=$oltp_table_num --num-threads=$num_thread --max-requests=0 --max-time=$max_time run


補(bǔ)充下,如果要使用 --max-time這個(gè)參數(shù), 需要配合--max-requests=0。
  --max-requests=N            limit for total number of requests [10000]
如果N=0將取消max-requests的限制


]]>
About mysqldump of MySQL 5.5 backup information_schema & performance_schema databaseshttp://www.aygfsteel.com/miaoyachun/archive/2012/05/11/377894.htmlMilo的海域Milo的海域Fri, 11 May 2012 06:01:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/05/11/377894.htmlhttp://www.aygfsteel.com/miaoyachun/comments/377894.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/05/11/377894.html#Feedback1http://www.aygfsteel.com/miaoyachun/comments/commentRss/377894.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/377894.htmlMySQL 5.5多出了兩個(gè)新數(shù)據(jù)庫(kù) information_schema performance_schema

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema | 
| mysql              | 
| performance_schema | 
| test               | 
+--------------------+
   

但是用mysqldump去備份這兩個(gè)數(shù)據(jù)庫(kù)的時(shí)候都會(huì)報(bào)錯(cuò)

mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES

mysqldump: Got error: 
1142: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances' when using LOCK TABLES

用--all-databases備份時(shí)也不會(huì)備份這兩個(gè)數(shù)據(jù)庫(kù)
官方文檔里解釋到:
http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

總結(jié)一下,如果一定要用mysqldump去備份這兩個(gè)數(shù)據(jù)庫(kù)不是不可以,但是得disable lock tables。 我用的是:
--database information_schema --lock-tables=0




]]>
幾個(gè)ssh管道用法http://www.aygfsteel.com/miaoyachun/archive/2012/05/09/377721.htmlMilo的海域Milo的海域Wed, 09 May 2012 09:13:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/05/09/377721.htmlhttp://www.aygfsteel.com/miaoyachun/comments/377721.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/05/09/377721.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/377721.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/377721.html
1. remote file copy
[root@xen74v01 ~]# cat test.pl
#!/usr/bin/perl
print 
"eth0.74"=~/(\w+)/;
print "\n";
[root@xen74v01 ~]# cat test.pl | ssh 10.1.74.76 'cat - > /tmp/test.pl'

拷貝文件時(shí),如果文件很大,又不想影響網(wǎng)絡(luò)IO可以用pv工具進(jìn)行流量控制
pv -L10m test.pl | ssh 10.1.74.76 'cat - > /tmp/test.pl'
這里pv的行為跟cat比較類似,但是支持IO流量控制,這里設(shè)置10M/s.

2. local script remote execute
[root@xen74v01 ~]# cat test.pl
#!/usr/bin/perl
print 
"eth0.74"=~/(\w+)/;
print "\n";
[root@xen74v01 ~]# perl test.pl
eth0
[root@xen74v01 ~]# cat test.pl | ssh 10.1.74.76 'perl'
eth0
[root@xen74v01 ~]# ssh 10.1.74.76 'perl' < test.pl
eth0

這樣就不用把腳本拷貝到遠(yuǎn)端去執(zhí)行了

參考:
http://linux.icydog.net/ssh/piping.php
http://www.ivarch.com/programs/quickref/pv.shtml
http://www.mysqlperformanceblog.com/2009/05/20/hint-throttling-xtrabackup/


]]>
innobackupex & FLUSH TABLES WITH READ LOCKhttp://www.aygfsteel.com/miaoyachun/archive/2012/04/10/373726.htmlMilo的海域Milo的海域Tue, 10 Apr 2012 09:19:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/04/10/373726.htmlhttp://www.aygfsteel.com/miaoyachun/comments/373726.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/04/10/373726.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/373726.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/373726.html當(dāng)innobackupex 做全備的時(shí)候(my version 1.6.5), 當(dāng)備份到MyISAM數(shù)據(jù)時(shí), innobackupex 會(huì)flush tables with read lock, 來禁止MyISAM的寫操作. (假設(shè)沒有--no-lock選項(xiàng))

sub backup {

    
if (!$option_incremental && !$option_no_lock) {
        
# make a prep copy before locking tables, if using rsync
        backup_files(1);

        
# flush tables with read lock
        mysql_lockall();
    }

    
if ($option_slave_info) {
        write_slave_info();
    }

}

sub mysql_lockall {

    
if (compare_versions($mysql_server_version, '4.0.22'== 0
        
|| compare_versions($mysql_server_version, '4.1.7'== 0) {
        
# MySQL server version is 4.0.22 or 4.1.7
        mysql_send "COMMIT;";
        mysql_send 
"FLUSH TABLES WITH READ LOCK;";
    } 
else {
        
# MySQL server version is other than 4.0.22 or 4.1.7
        mysql_send "FLUSH TABLES WITH READ LOCK;";
        mysql_send 
"COMMIT;";
    }
    write_binlog_info;


}

但是如果備份的時(shí)候還有很重的workload, "flush tables with read lock" 可能會(huì)比較耗時(shí). 這里參考了:

http://www.mysqlperformanceblog.com/2010/04/24/how-fast-is-flush-tables-with-read-lock/

看了下--no-lock的選項(xiàng)說明:

    --no-lock
        Use this option to disable table lock with 
"FLUSH TABLES WITH READ
        LOCK
". Use it only if ALL your tables are InnoDB and you DO NOT CARE
        about the binary log position of the backup.

如果我們能保證workload僅僅是innodb相關(guān)的,我們可以使用這個(gè)選項(xiàng)。

記得在1.5版本的時(shí)候,使用--no-lock選項(xiàng)會(huì)導(dǎo)致xtrabackup_slave_info沒有保存?zhèn)浞輹r(shí)的logfile & pos. 這個(gè)問題在1.6.5被解決了

    if ($option_slave_info) {
        write_slave_info();
    }

xtrabackup_slave_info & xtrabackup_binlog_info文件在1.5版本是在mysql_lockall函數(shù)里更新的。但是新版本已經(jīng)把write_slave_info提到mysql_lockall外面了。


]]>
innobackupex 1.6.4 need empty datadir when copy-backhttp://www.aygfsteel.com/miaoyachun/archive/2012/04/03/373276.htmlMilo的海域Milo的海域Tue, 03 Apr 2012 05:01:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/04/03/373276.htmlhttp://www.aygfsteel.com/miaoyachun/comments/373276.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/04/03/373276.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/373276.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/373276.html
IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackupex-
1.6.4
           prints 
"completed OK!".

Original data directory is not empty! at innobackupex-
1.6.4 line 544.

when read those lines we found that:
    # check that original data directories exist and they are empty
    if_directory_exists_and_empty($orig_datadir
, "Original data");
    if_directory_exists_and_empty($orig_ibdata_dir, "Original InnoDB data");
    if_directory_exists_and_empty($orig_iblog_dir, "Original InnoDB log");

Google for reason for this check and find it mentioned in:
http://www.mysqlperformanceblog.com/2011/12/19/percona-xtrabackup-1-6-4/

innobackupex did not check that MySQL datadir was empty before –copy-back was run. With this bug fix,
innobackupex will now error out of the –copy-back operation if the destination is not empty
, avoiding
potential data loss or a strang combination of a restored backup and previous data. Bug Fixed: #
737569 (Valentine Gostev)



]]>
Setup MySQL CDT DEV Enviromenthttp://www.aygfsteel.com/miaoyachun/archive/2012/03/23/372566.htmlMilo的海域Milo的海域Fri, 23 Mar 2012 09:49:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/03/23/372566.htmlhttp://www.aygfsteel.com/miaoyachun/comments/372566.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/03/23/372566.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/372566.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/372566.html1. install bzr tool, ref http://dev.mysql.com/doc/refman/5.1/en/installing-development-tree.html
2. download mysql 5.1 code from trunk
3. autoreconf --force --install
4. ./configure --with-debug --without-libedit --with-plugins=innobase
5. make & sudo make install
6. setup eclipse cdt env
    a. startup eclipse by sudo cmd or root user
    b. build project
    c. set debug diag, ref http://forge.mysql.com/wiki/Eclipse/CDT_on_Linux_and_Mac_OS_X, here is my "program parameters" when startup mysqld instance:
    --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --port=3306 --socket=/tmp/mysql.sock --default-storage-engine=innodb



]]>
How to use sysbench test mysqlhttp://www.aygfsteel.com/miaoyachun/archive/2012/03/19/372203.htmlMilo的海域Milo的海域Mon, 19 Mar 2012 08:35:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/03/19/372203.htmlhttp://www.aygfsteel.com/miaoyachun/comments/372203.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/03/19/372203.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/372203.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/372203.html# parepare test database
createDB="drop database if exists $database; create database if not exists $database;"
mysql -$vip --port=$port -uadmin -padmin -"$createDB"

# prepare data
prepare="$sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=$row"
prepare
="$prepare --mysql-port=$port --mysql-host=$vip --mysql-db=$database"
prepare
="$prepare --mysql-password=admin --mysql-user=admin prepare"
$prepare

# run sysbench
#
 http://sysbench.sourceforge.net/docs/#database_mode see this link for more options
run="$sysbench --test=oltp --mysql-table-engine=innodb --init-rng --oltp-table-size=$row"
run
="$run --max-requests=0 --max-time=900 --num-threads=128 --oltp-test-mode=complex"
run
="$run --oltp-point-selects=2 --oltp-simple-ranges=1 --oltp-sum-ranges=2"
run
="$run --oltp-index-updates=10 --oltp-non-index-updates=5 --mysql-port=$port"
run
="$run --mysql-db=$database --mysql-host=$vip --mysql-password=admin --mysql-user=admin"

# support oltp-user-delay-min to add delay for each sysbench request
if [[ "$lag" != "nolag" ]]
then
    run
="$run --oltp-user-delay-min=$lag"
fi
run
="$run run"

]]>
innodb_flush_log_at_trx_commit optionhttp://www.aygfsteel.com/miaoyachun/archive/2012/02/23/370599.htmlMilo的海域Milo的海域Thu, 23 Feb 2012 08:28:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/02/23/370599.htmlhttp://www.aygfsteel.com/miaoyachun/comments/370599.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/02/23/370599.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/370599.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/370599.htmlinnodb_flush_log_at_trx_commit

這個(gè)參數(shù)的配置涉及trax提交寫trax log文件的行為
innodb_flush_log_at_trx_commit = 0
# 每秒寫一次trax log
,并執(zhí)行fsync

innodb_flush_log_at_trx_commit 
= 1
# 每次trax 提交的時(shí)候?qū)懸淮蝨rax log
, 并執(zhí)行fsync

innodb_flush_log_at_trx_commit 
= 2
# 每次trax 提交的時(shí)候?qū)懸淮蝨rax log
, 不會(huì)執(zhí)行fsync


]]>
指定mysql默認(rèn)字符集http://www.aygfsteel.com/miaoyachun/archive/2012/01/31/369070.htmlMilo的海域Milo的海域Tue, 31 Jan 2012 05:18:00 GMThttp://www.aygfsteel.com/miaoyachun/archive/2012/01/31/369070.htmlhttp://www.aygfsteel.com/miaoyachun/comments/369070.htmlhttp://www.aygfsteel.com/miaoyachun/archive/2012/01/31/369070.html#Feedback0http://www.aygfsteel.com/miaoyachun/comments/commentRss/369070.htmlhttp://www.aygfsteel.com/miaoyachun/services/trackbacks/369070.html從源碼安裝mysql時(shí)指定默認(rèn)字符集:
  1. ./configure ... '--with-charset=utf8' '--with-collation=utf8_general_ci' ...
  2. make & make install
  3. start mysql instance

驗(yàn)證:



也可以在my.cnf里面修改默認(rèn)字符集:

default-character-set=latin1





]]>
主站蜘蛛池模板: 津市市| 福海县| 囊谦县| 南涧| 类乌齐县| 大宁县| 炉霍县| 满城县| 黔西县| 玉田县| 武义县| 兴义市| 古浪县| 龙陵县| 花莲市| 灵武市| 台江县| 勐海县| 华蓥市| 永平县| 内乡县| 海伦市| 明光市| 苏尼特右旗| 朝阳市| 彭水| 策勒县| 灵山县| 喀喇沁旗| 永吉县| 东阿县| 吉木乃县| 自贡市| 鞍山市| 渝北区| 兴隆县| 平阳县| 益阳市| 龙里县| 凤冈县| 饶阳县|