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

MySql ´æ´¢¹ý³ÌÓαêʹÓÃʾÀý

DROP PROCEDURE IF exists pro_removeBillRemindByUserId;
create procedure pro_removeBillRemindByUserId(userId int)
begin
    declare ts varchar(500);
    declare cnt int default 0;
    declare f_ID,b  int;
    DECLARE cur_1 CURSOR FOR select  FID from t_bill  where FUserId=userId;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET b = 1;
OPEN cur_1;
REPEAT
FETCH cur_1 INTO f_ID;
    delete from t_bill_remind where FBillID=f_ID;
UNTIL b = 1
END REPEAT;
    close cur_1;
end;
//µ÷Óô洢¹ý³Ì
call pro_removeBillRemindByUserId(678);


Ïà¹ØÎĵµ£º

MySql´´½¨º¯Êý

Ê×ÏÈÐèÒª²é¿´Ò»Ï´´½¨º¯ÊýµÄ¹¦ÄÜÊÇ·ñ¿ªÆô£º
mysql> show variables like '%func%';
+-----------------------------------------+-------+
| Variable_name                          ......

mysql hibernateÖ÷¼üÅäÖÃ

  ÔÚ½üÆÚµÄÏîĿά»¤¹¤×÷ÖУ¬Ê±³£³öÏÖÖ÷¼üÖظ´µÄÒì³£¡£¾­¹ýһϵÁÐ×ÊÁϵIJéѯ֮ºó£¬·¢ÏÖʱhibernateÓ³ÉäÎļþÅäÖÃÎÊÌâ¡£
  mysqlÌṩÖ÷¼ü“×Ô¶¯ÔöÁ¿”µÄÅäÖã¬Ö¸¶¨¸ÃÀàÐ͵ÄÖ÷¼ü£¬mysqlÄܹ»×Ô¶¯¼ÓÒ»¡£
  ÔÚhibernateÓ³ÉäÎļþÖУ¬¹ØÓÚÖ÷¼üµÄÅäÖò»ÄÜÊÇ
<generator class="increment"&g ......

²é¿´MySQLµÄÖ´Ðмƻ®

1.²é¿´MySQL·ÖÇø±íµÄÖ´Ðмƻ®:
×¢Òâ:¶ÔMySQL·ÖÇø±í°´·ÖÇø²éѯ,²»ÓÃÏñOracleÄÇÑù,ÔÚSQLÖÐÌí¼Ó“PARTITION”×Ö·û´®¡£
Ìáʾ£ºÊ¹Ó÷ÖÇø¹¦ÄÜÖ®ºó£¬Ïà¹Ø²éѯ×îºÃ¶¼ÓÃEXPLAIN PARTITIONS¹ýÒ»±é£¬È·ÈÏ·ÖÇøÊÇ·ñÉúЧ¡£ÀýÈç:
EXPLAIN PARTITIONS SELECT * from tab_test WHERE created = '2008-01-02';
2.²é¿´MySQLÆÕͨ± ......

ÕÒ»Ømysql µÄroot ÃÜÂë

£¨1£©ÒÔubuntuµÄrootÓû§µÇ½
£¨2£©Í£Ö¹MYSQL·þÎñÆ÷£º
        /etc/init.d/mysql stop
£¨3£©Ìø¹ýÊÚȨ±íÖ´ÐÐMYSQL·þÎñÆ÷£º
       mysqld_safe --skip-grant-tables --skip-networking &
 (×¢£º²ÎÊý--skip-grant-tablesΪÌø¹ýÊÚȨ±í£»--sk ......

MYSQLÍâ¼ü(Foreign Key)µÄʹÓÃ


ÔÚMySQL 3.23.44°æ±¾ºó£¬InnoDBÒýÇæÀàÐ͵ıíÖ§³ÖÁËÍâ¼üÔ¼Êø¡£
Íâ¼üµÄʹÓÃÌõ¼þ£º
1.Á½¸ö±í±ØÐëÊÇ
InnoDB±í£¬MyISAM±íÔÝʱ²»Ö§³ÖÍâ¼ü£¨¾Ý˵ÒÔºóµÄ°æ±¾ÓпÉÄÜÖ§³Ö£¬µ«ÖÁÉÙÄ¿Ç°²»Ö§³Ö£©£»
2.Íâ¼üÁбØÐ뽨Á¢ÁËË÷Òý£¬MySQL
4.1.2ÒÔºóµÄ°æ±¾ÔÚ½¨Á¢Íâ¼üʱ»á×Ô¶¯´´½¨Ë÷Òý£¬µ«Èç¹ûÔÚ½ÏÔçµÄ°æ±¾ÔòÐèÒªÏÔʾ½¨Á¢£»
3.Íâ¼ü¹Øϵµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ