mysqlµÄ±¸·ÝºÍ»¹ÔµÄ±àÂëÎÊÌâ½â¾ö
½ñÌìÐèÒª´ÓÔ¶³Ì·þÎñÆ÷downÒ»¸öuchomeµÄÊý¾Ý¿âÏÂÀ´£¬ÔÚ±¾µØ»¹Ô¡£
·¢ÏÖÒ»¸öºÜ²»Ë¬µÄÊÂÇ飺Զ³Ì8G£¬NºËµÄlinux»úÆ÷£¬±¸·Ý»¹Ô²Ù×÷˳ÁïÁïµÄ£¬¿ÉÊÇÔÚ±¾µØµÄwindows£¬2GÆÕͨPCÉÏ£¬²Å100MµÄÎļþ£¬ÓÃuchome×Ô´øµÄ·Ö¾í±¸·Ý»¹Ô£¬»ù±¾ÉÏÖм䶼»á¶Ïµô£¬ÒªÃ´Ìáʾ“Ö´ÐÐʱ¼ä¹ý³¤”£¨¸Ä³É200Ã룬·Ö¾íΪ20M¶¼²»ÐУ©£¬ÒªÃ´¾ÍÊÇÖÐ;°×ÆÁ¡£
µÃÁË£¬ÓÃmysqldump±¸·ÝµÄÒ»¸ö¶ÀÁ¢ÎļþÀ´ÔËÐÐÃüÁîÐл¹Ô°É¡£
Ê×ÏÈÔËÐл¹ÔÓï¾ä£º
mysql -uroot -p123456 mydatabase < d:\backupdatabase.sql
ʱ¼ä»ºÂýµØÊÅÈ¥£¬Ò»¿ÚË®ºÈÍ꣬Éϸö²ÞËù£¬ÔÙÁï´ïһϣ¬ÖÕÓÚÍê³ÉÁË£¨ÔÚÔ¶³Ìlinux·þÎñÆ÷ÉÏÒ²¾Í20ÃëµÄ¹¦·ò£¡£©
È»ºó¸üлº´æ£¬·¢ÏÖÊý¾ÝÂÒÂëÁË£¬ß×£¬ÎÒ±¸·ÝµÄʱºòÊÇÇ¿ÖƵÄgbk±àÂë°¡£¡¿´¿´±¸·ÝµÄÓï¾ä£º
mysqldump -uroot -p123456 –default-character-set=gbk mydatabase > /usr/local/mysql/backup/backup20091026.sql
û´í°¡£¡ÒѾÉèÖÃÁËĬÈÏ×Ö·û¼¯ÎªgbkÁË£¬¿´À´¿ÉÄÜÊÇÔÚ»¹ÔµÄʱºòÒ²ÒªÉèÖðɣ¬ÓÚÊÇÐ޸Ļ¹ÔÓï¾ä£¬ÊÖ¹¤Ö¸¶¨×Ö·û±àÂë
mysql -uroot -p123456 font –default-character-set=gbk mydatabase < d:\backupdatabase.sql
ÓÖÊÇÂþ³¤µÄµÈ´ý…Ë¢ÐÂÒ³ÃæÒ»¿´£¬ÏÖÔÚÂÒÂë½â¾öÁË¡£
×ܽ᣺ÔÚ²»Í¬µÄ²Ù×÷ϵͳºÍÊý¾Ý¿â»·¾³Ö®¼ä±¸·ÝÓ뻹Ôʱ£¬»¹ÊÇÁ½±ß¶¼Ç¿ÖÆÖƶ¨Ò»¸ö×Ö·û¼¯×î±£ÏÕ¡£
Ïà¹ØÎĵµ£º
È¡µÃÎÄÕ¹ؼü×ÖΪkeywords
±ínewsµÄ¹Ø¼ü×Ö×Ö¶ÎΪkeyword
keywords=keywords.replace(',','|');
String sql="SELECT * from news WHERE keyword REGEXP '"+keywords+"' ORDER BY id ";
ÓÉÓÚijЩÔÒò£¬ÓÐʱºòÎÒÃÇûÓа´ÕÕ·¶Ê½µÄÉè¼Æ×¼Ôò¶ø°ÑһЩÊôÐԷŵ½Í¬Ò»¸ö×Ö·û´®×Ö¶ÎÖС£±ÈÈç¸öÈËÐËȤ£¬ÓÐʱºòÎÒÃÇÉè¼Æ±íΪ
cr ......
·ÀÖ¹×¢ÈëµÄ¼¸ÖÖ°ì·¨
ÆäʵÔÀ´¾ÍÊÇÎÒÃÇÐèÒª¹ýÂËһЩÎÒÃdz£¼ûµÄ¹Ø¼ü×ֺͷûºÏÈ磺
Select£¬insert£¬update£¬delete£¬and£¬*£¬µÈµÈ
function inject_check($sql_str) {
return eregi('select|insert|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file
|outfile', $sql_str); & ......
MySqlÊý¾Ý¿âµÄÁÐÀàÐÍ£¨×Ö¶ÎÀàÐÍ)
MySQLÊý¾Ý¿âµÄ±íÊÇÒ»¸ö¶þά±í£¬ÓÉÒ»¸ö»ò¶à¸öÊý¾ÝÁй¹³É¡£
ÿ¸öÊý¾ÝÁж¼ÓÐËüµÄÌض¨ÀàÐÍ£¬¸ÃÀàÐ;ö¶¨ÁËMySQLÈçºÎ¿´´ý¸ÃÁÐÊý¾Ý£¬ÎÒÃÇ¿ÉÒÔ°ÑÕûÐÍÊýÖµ´æ·Åµ½×Ö·ûÀàÐ͵ÄÁÐÖУ¬MySQLÔò»á°ÑËü¿´³É×Ö·û´®À´´¦Àí¡£
MySQLÖеÄÁÐÀàÐÍÓÐÈýÖÖ£ºÊýÖµÀà¡¢×Ö·û´®ÀàºÍÈÕÆÚ/ʱ¼äÀà¡£
´Ó´óÀàÀ´¿´ÁÐÀàÐͺÍÊýÖ ......
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql –hÖ÷»úµØÖ· –uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£º ......
1.CREATE USER
CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']
[, user [IDENTIFIED BY [PASSWORD] 'password']] ...
CREATE USERÓÃÓÚ´´½¨ÐµÄMySQLÕË»§¡£ÒªÊ¹ÓÃCREATE USER£¬Äú±ØÐëÓµÓÐmysqlÊý¾Ý¿âµÄÈ«¾ÖCREATE USERȨÏÞ£¬»òÓµÓÐINSERTȨÏÞ¡£¶ÔÓÚÿ¸öÕË»§£¬CREATE USER»áÔÚûÓÐȨÏÞµÄmysq ......