Mysql¿ªÆôÈÕÖ¾
ÔÎÄת×Ô:http://hi.baidu.com/jackli00/blog/item/21b2e242025bfa1473f05d24.html
Mysql¿ªÆôÈÕÖ¾
2008-11-18 11:23
ÊÇ·ñÆôÓÃÁËÈÕÖ¾
mysql>show variables like 'log_bin';
ÔõÑùÖªµÀµ±Ç°µÄÈÕÖ¾
mysql> show master status;
¿´¶þ½øÖÆÈÕÖ¾ÎļþÓÃmysqlbinlog
shell>mysqlbinlog mail-bin.000001(Ҫд¾ø¶ÔÎÊÌâ·¾¶¡¡d://)
»òÕßshell>mysqlbinlog mail-bin.000001 | tail
Windows ÏÂÓÃÀàËÆµÄÃüÁî¡£
mysqlÓÐÒÔϼ¸ÖÖÈÕÖ¾£º
´íÎóÈÕÖ¾£º -log-err
²éѯÈÕÖ¾£º -log
Âý²éѯÈÕÖ¾: -log-slow-queries
¸üÐÂÈÕÖ¾: -log-update
¶þ½øÖÆÈÕÖ¾£º -log-bin
ÔÚmysqlµÄ°²×°Ä¿Â¼Ï£¬´ò¿ªmy.ini,ÔÚºóÃæ¼ÓÉÏÉÏÃæµÄ²ÎÊý£¬±£´æºóÖØÆômysql·þÎñ¾ÍÐÐÁË¡£
ÀýÈ磺
#Enter a name for the error log file. Otherwise a default name will be used.
log-error=err.log
#Enter a name for the query log file. Otherwise a default name will be used.
#log=
#Enter a name for the slow query log file. Otherwise a default name will be used.
#log-slow-queries=
#Enter a name for the update log file. Otherwise a default name will be used.
#log-update=
#Enter a name for the binary log. Otherwise a default name will be used.
#log-bin=
ÉÏÃæÖ»¿ªÆôÁË´íÎóÈÕÖ¾£¬Òª¿ªÆäËûµÄÈÕÖ¾¾Í°ÑÇ°ÃæµÄ“#”È¥µô¡£
long_query_time =1 --ÊÇÖ¸Ö´Ðг¬¹ý¶à¾ÃµÄsql»á±»logÏÂÀ´£¬ÕâÀïÊÇ1Ãë
log-slow-queries=slowqueris.log --½«²éѯ·µ»Ø½ÏÂýµÄÓï¾ä½øÐмǼ
log-queries-not-using-indexes = nouseindex.log --¾ÍÊÇ×ÖÃæÒâ˼£¬logÏÂÀ´Ã»ÓÐʹÓÃË÷ÒýµÄquery
log=mylog.log --¶ÔËùÓÐÖ´ÐÐÓï¾ä½øÐмǼ
log-error=log-error.log
log=log-query.log
log-queries-not-using-indexes
log-warnings=2
log-slow-queries=log-slow-query.log
log-update=log-update.log
long_qu
Ïà¹ØÎĵµ£º
¸ÅÊö£º
1.ÂÒÂëÎÊÌâ¹é¸ùµ½µ×ÊÇ×Ö·û¼¯µÄÎÊÌâ,ÄǾʹÓ×Ö·û¼¯ÉèÖ÷½Ã濼ÂÇ,²»ÍâºõÏÂÃæ¼¸·½Ã棺
server(Mysql·þÎñÆ÷),client,database(Êý¾Ý¿â),connection(Á¬½Ó),result
MySQLµÄ×Ö·û¼¯´¦ÀíÊÇÕâÑùµÄ£º
£¨1£©·¢ËÍÇëÇó
¿Í»§¶Ë(character_set_client£©=¡·Êý¾ ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
ËùÓеÄÊýѧº¯ÊýÔÚÒ»¸ö³ö´íµÄÇé¿öÏ·µ»ØNULL¡£
-
µ¥Ä¿¼õ¡£¸Ä±ä²ÎÊýµÄ·ûºÅ¡£
mysql> select - 2;
×¢Ò⣬Èç¹ûÕâ¸ö²Ù×÷·ûÓëÒ»¸öBIGINTʹÓ㬷µ»ØÖµÊÇÒ»¸öBIGINT£¡ÕâÒâζ×ÅÄãÓ¦¸Ã±ÜÃâÔÚÕûÊýÉÏʹÓÃ-£¬ÄÇ¿ÉÄÜÓÐÖµ-2^63£¡
ABS(X)
·µ»ØXµÄ¾ø¶ÔÖµ¡£
mysql> select ABS(2);&n ......
drop table student;
create table student
(sno int not null unique,
sname varchar(8) not null,
ssex char(2) not null,
sage int ,
sdept varchar(20));
select * from student;
alter table student drop uniq ......
conn.php
<?php
/*
* Created on 2010-1-6
* Author:CHAUVET
* Function:Á¬½Ó×Ö·û´®
*/
$conn=@mysql_connect("localhost","root","")or die("Á¬½ÓÊý¾Ý¿â³ö´í£¡");
mysql_select_db("newdb",$conn);
mysql_query("set names 'gb2312'");
function ReplaceSom ......