亚洲日本在线观看视频,爱情岛论坛亚洲品质自拍视频网站 ,亚洲精品国产va在线观看蜜芽http://www.tkk7.com/miaoyachun/category/50698.htmlzh-cnWed, 04 Jul 2012 07:07:42 GMTWed, 04 Jul 2012 07:07:42 GMT60SQL連接查詢http://www.tkk7.com/miaoyachun/archive/2012/07/04/382161.htmlMilo的海域Milo的海域Wed, 04 Jul 2012 01:35:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/07/04/382161.htmlhttp://www.tkk7.com/miaoyachun/comments/382161.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/07/04/382161.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/382161.htmlhttp://www.tkk7.com/miaoyachun/services/trackbacks/382161.htmlSQL連接查詢

]]>
About cannot core dump after setuid on linux serverhttp://www.tkk7.com/miaoyachun/archive/2012/05/30/379560.htmlMilo的海域Milo的海域Wed, 30 May 2012 07:32:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/05/30/379560.htmlhttp://www.tkk7.com/miaoyachun/comments/379560.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/05/30/379560.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/379560.htmlhttp://www.tkk7.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.tkk7.com/miaoyachun/archive/2012/05/14/378114.htmlMilo的海域Milo的海域Mon, 14 May 2012 08:10:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/05/14/378114.htmlhttp://www.tkk7.com/miaoyachun/comments/378114.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/05/14/378114.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/378114.htmlhttp://www.tkk7.com/miaoyachun/services/trackbacks/378114.html
Download src code
bzr branch lp:sysbench

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

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

下面這個文章對0.5的sysbench有個比較全面的介紹:
./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


補充下,如果要使用 --max-time這個參數(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.tkk7.com/miaoyachun/archive/2012/05/11/377894.htmlMilo的海域Milo的海域Fri, 11 May 2012 06:01:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/05/11/377894.htmlhttp://www.tkk7.com/miaoyachun/comments/377894.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/05/11/377894.html#Feedback1http://www.tkk7.com/miaoyachun/comments/commentRss/377894.htmlhttp://www.tkk7.com/miaoyachun/services/trackbacks/377894.htmlMySQL 5.5多出了兩個新數(shù)據(jù)庫 information_schema performance_schema

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

但是用mysqldump去備份這兩個數(shù)據(jù)庫的時候都會報錯

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ù)據(jù)庫
官方文檔里解釋到:
http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

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




]]>
幾個ssh管道用法http://www.tkk7.com/miaoyachun/archive/2012/05/09/377721.htmlMilo的海域Milo的海域Wed, 09 May 2012 09:13:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/05/09/377721.htmlhttp://www.tkk7.com/miaoyachun/comments/377721.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/05/09/377721.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/377721.htmlhttp://www.tkk7.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'

拷貝文件時,如果文件很大,又不想影響網(wǎng)絡IO可以用pv工具進行流量控制
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

這樣就不用把腳本拷貝到遠端去執(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.tkk7.com/miaoyachun/archive/2012/04/10/373726.htmlMilo的海域Milo的海域Tue, 10 Apr 2012 09:19:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/04/10/373726.htmlhttp://www.tkk7.com/miaoyachun/comments/373726.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/04/10/373726.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/373726.htmlhttp://www.tkk7.com/miaoyachun/services/trackbacks/373726.html當innobackupex 做全備的時候(my version 1.6.5), 當備份到MyISAM數(shù)據(jù)時, innobackupex 會flush tables with read lock, 來禁止MyISAM的寫操作. (假設(shè)沒有--no-lock選項)

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;


}

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

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

看了下--no-lock的選項說明:

    --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)的,我們可以使用這個選項。

記得在1.5版本的時候,使用--no-lock選項會導致xtrabackup_slave_info沒有保存?zhèn)浞輹r的logfile & pos. 這個問題在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.tkk7.com/miaoyachun/archive/2012/04/03/373276.htmlMilo的海域Milo的海域Tue, 03 Apr 2012 05:01:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/04/03/373276.htmlhttp://www.tkk7.com/miaoyachun/comments/373276.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/04/03/373276.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/373276.htmlhttp://www.tkk7.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.tkk7.com/miaoyachun/archive/2012/03/23/372566.htmlMilo的海域Milo的海域Fri, 23 Mar 2012 09:49:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/03/23/372566.htmlhttp://www.tkk7.com/miaoyachun/comments/372566.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/03/23/372566.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/372566.htmlhttp://www.tkk7.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.tkk7.com/miaoyachun/archive/2012/03/19/372203.htmlMilo的海域Milo的海域Mon, 19 Mar 2012 08:35:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/03/19/372203.htmlhttp://www.tkk7.com/miaoyachun/comments/372203.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/03/19/372203.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/372203.htmlhttp://www.tkk7.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.tkk7.com/miaoyachun/archive/2012/02/23/370599.htmlMilo的海域Milo的海域Thu, 23 Feb 2012 08:28:00 GMThttp://www.tkk7.com/miaoyachun/archive/2012/02/23/370599.htmlhttp://www.tkk7.com/miaoyachun/comments/370599.htmlhttp://www.tkk7.com/miaoyachun/archive/2012/02/23/370599.html#Feedback0http://www.tkk7.com/miaoyachun/comments/commentRss/370599.htmlhttp://www.tkk7.com/miaoyachun/services/trackbacks/370599.htmlinnodb_flush_log_at_trx_commit

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

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

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


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

驗證:



也可以在my.cnf里面修改默認字符集:

default-character-set=latin1





]]>
主站蜘蛛池模板: 免费国产草莓视频在线观看黄| 2019中文字幕在线电影免费| 国产亚洲福利精品一区| 99xxoo视频在线永久免费观看| 亚洲 日韩 色 图网站| 久久久久亚洲av成人无码电影| 91青青国产在线观看免费| 亚洲国产成人AV网站| 亚洲熟妇av一区二区三区| 毛片免费在线视频| 中文字幕永久免费| 亚洲综合久久精品无码色欲| 久久精品国产亚洲5555| 2020久久精品国产免费| 久久久久国色AV免费观看| 亚洲一级免费毛片| 亚洲精品国产精品乱码视色| 在线天堂免费观看.WWW| 男女午夜24式免费视频| 国产亚洲精品欧洲在线观看| 亚洲成人免费电影| 亚洲午夜AV无码专区在线播放 | 国产一级在线免费观看| 亚洲影视自拍揄拍愉拍| 亚洲精品中文字幕乱码三区| 免费黄色app网站| 57pao国产成永久免费视频| 永久免费观看黄网站| 亚洲深深色噜噜狠狠网站| 亚洲国产老鸭窝一区二区三区| 一本色道久久88亚洲综合| 成人浮力影院免费看| 免费无码又爽又刺激高潮软件| 激情无码亚洲一区二区三区| 亚洲激情校园春色| 亚洲av福利无码无一区二区| 亚洲人成色7777在线观看不卡| 免费黄色app网站| 成人片黄网站A毛片免费| 一级毛片免费毛片一级毛片免费| 一区二区三区免费视频网站|