Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MySqlÊý¾Ý¿â°æ±¾²éѯ

MySql°æ±¾ÐÅÏ¢µÄ²éѯ£º
1¡¢Í¨¹ýmysql -VÃüÁî²éѯ
C:\mysql\bin>mysql -V
mysql  Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
2¡¢Í¨¹ýmysqlģʽϵÄstatusÃüÁî²é¿´×´Ì¬
mysql> status
--------------
mysql  Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
Connection id:          14933
Current database:       mysql
Current user:           root@localhost
SSL:                    Not in use
Server version:         4.0.18-nt
Protocol version:       10
Connection:             localhost via TCP/IP
Client characterset:    latin1
Server characterset:    latin1
TCP port:               3306
Uptime:                 19 hours 24 min 41 sec
Threads: 2  Questions: 37443  Slow queries: 0  Opens: 355  Flush tables: 1  Open
 tables: 9  Queries per second avg: 0.536
--------------
mysql>
 
3¡¢Í¨¹ýmysqlģʽϵÄselectÓï¾ä²éѯ
mysql> select version();
+-----------+
| version() |
+-----------+
| 4.0.18-nt |
+-----------+
1 row in set (0.00 sec)
mysql>
 
4¡¢Í¨¹ýmysql --helpÃüÁî½øÐв鿴
C:\mysql\bin>mysql --help
mysql  Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
Copyright (C) 2002 MySQL AB
......
 
תÌû£ºhttp://www.hackbase.com/tech/2009-06-25/53429.html


Ïà¹ØÎĵµ£º

mysql×Ö·û¼¯ÎÊÌâ

MySQLµÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺
     ×Ö·û¼¯(Character set)ºÍÅÅÐò·½Ê½(Collation)¡£
¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î:
     ·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£
1.MySQLĬÈÏ×Ö·û¼¯
  MySQL¶ÔÓÚ×Ö·û¼¯µÄ ......

mysqlµÄһЩ¸ß¼¶Óï¾ä

Ò»,½ñÌì¸ø´ó¼Ò½²Ò»ÏÂ,×öÁôÑÔµÄÒ»ÖÖ×·¼ÓµÄ·½Ê½Ö÷ÒªÈç¹ûµ±Ç°ÓÐÁôÑÔ,¾Í¸üе±Ç°µÄÁôÑÔÒÔ×·¼ÓµÄ·½Ê½,Èç¹ûûÄÜÁôÑԾͽ«ÈëÒ»ÌõеÄ
mysql:insert into `table` (field) values ('$value') on duplicate key update `field`=concat('value',ifnull(`field`,''));
¾ßÌå±¾ÌõSQLµÄÓ÷¨,Çë²é¿´ÊÖ²á
¶þ,½²Ò»ÏÂͳ¼ÆµÄÓ÷¨,Ö÷Òª½éÉÜÈçº ......

ɾ³ýMYSQl BIN LOG ÈÕÖ¾

1.²é¿´µµ°¸
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| ablelee.000001 | 150462942 |
| ablelee.000002 | 125 |
| ablelee.000003 | 106 |
+----------------+-----------+
2.ɾ³ýbin-log(ɾ³ýablelee.000003֮ǰµÄ¶øûÓаüº¬ablel ......

mysqlÊý¾ÝUnixʱ¼ä´ÁÓëC# DateTimeʱ¼äÀàÐÍ»¥»»

Unixʱ¼ä´Á×îСµ¥Î»ÊÇÃ룬¿ªÊ¼Ê±¼äΪ¸ñÁÖÍþÖαê׼ʱ¼ä1970-01-01 00:00:00
ConvertIntDateTime·½·¨µÄ»ù±¾Ë¼Â·ÊÇͨ¹ý»ñÈ¡±¾µØʱÇø±íʾUnixk¿ªÊ¼Ê±¼ä£¬¼ÓÉÏUnixʱ¼äÖµ£¨¼´¹ýÈ¥µÄÃëÊý£©.
ConvertDateTimeInt·½·¨µÄ»ù±¾Ë¼Â·ÊÇͨ¹ý¿Ì¶ÈÊý²î£¬Ôٰѿ̶ÈÊýת»»ÎªÃëÊý£¬µ±È»ÒªËµÃ÷µÄÊÇ£¬ÎÒÕâÀï·µ»ØµÄÊÇdoubleÀàÐÍ£¬ÒâÒåÉϲ¢·ÇÊÇÕæ ......

PHPÖеÄmysql_real_escape_stringº¯Êý

¸ù¾ÝÄãµÄʹÓÃÄ¿µÄÎÒ¾õµÃÕâ¸öº¯ÊýÓÐÁ½·½ÃæµÄÓÃ;£º
·ÀÖ¹SQL Injection¹¥»÷£¬Ò²¾ÍÊÇÄã±ØÐëÑéÖ¤Óû§µÄÊäÈë
²Ù×÷Êý¾ÝµÄʱºò±ÜÃâ²»±ØÒªµÄ×Ö·ûµ¼Ö´íÎó
mysql_real_escape_string() º¯ÊýתÒå SQL Óï¾äÖÐʹÓõÄ×Ö·û´®ÖеÄÌØÊâ×Ö·û¡£
ÏÂÁÐ×Ö·ûÊÜÓ°Ï죺
\x00
\n
\r
\
'
"
\x1a
Èç¹û³É¹¦£¬Ôò¸Ãº¯Êý·µ»Ø±»×ªÒåµÄ×Ö·û´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ