MySql ÅжϺº×Ö¡¢ÈÕÆÚ¡¢Êý×ֵĺ¯Êý
¼¸¸öƽ³£ÓõÄmysqlº¯Êý
/*****************************************************
1.ÅжÏ×Ö·û´®ÊÇ·ñΪºº×Ö ·µ»ØÖµ£º1-ºº×Ö 0-·Çºº×Ö
*****************************************************/
DROP FUNCTION IF EXISTS fc_is_hanzi;
CREATE FUNCTION fc_is_hanzi(
p_str VARCHAR(1024)
)
RETURNS int(11)
NOT DETERMINISTIC
SQL SECURITY DEFINER
COMMENT '¼ì²é×Ö·û´®ÊÇ·ñΪºº×Ö'
BEGIN
/*¼ì²é×Ö·û´®ÊÇ·ñΪºº×Ö ·µ»ØÖµ£º1-ºº×Ö 0-·Çºº×Ö*/
DECLARE _ret, i, other_cnt, l_acode INT DEFAULT 0;
SET _ret = 0;
SET i = 1;
SET other_cnt = 0;
SET l_acode = 0;
WHILE i <= CHAR_LENGTH(p_str) DO
SET l_acode = ASCII(SUBSTRING(p_str, i, 1));
IF l_acode<124 or l_acode>254 THEN
SET other_cnt = other_cnt + 1;
END IF;
SET i = i + 1;
END WHILE;
IF other_cnt = 0 THEN
SET _ret = 1;
ELSE
SET _ret = 0;
END IF;
RETURN _ret;
END;
/*****************************************************
2.ÅжÏÈÕÆÚ¸ñʽÊÇ·ñÕýÈ·£¨·µ»ØÖµ£º1-ÕýÈ· 0-´íÎó£©
*****************************************************/
DROP FUNCTION IF EXISTS fc_ck_date;
CREATE FUNCTION fc_ck_date(
p_cont CHAR(32)
)
RETURNS tinyint(4)
NOT DETERMINISTIC
SQL SECURITY DEFINER
COMMENT 'Åж¨ÈÕÆÚ¸ñʽÊÇ·ñÕýÈ·'
BEGIN
/*Åж¨ÈÕÆÚ¸ñʽÊÇ·ñÕýÈ·£¨·µ»ØÖµ£º1-ÕýÈ· 0-´íÎó£©*/
/*ÊäÈëÖµ¸ñʽΪ£ºyyyyMMdd »ò yyyy-MM-dd*/
IF(SELECT DATE_FORMAT(p_cont
Ïà¹ØÎĵµ£º
Ò»¡¢²ÎÕÕÍêÕûÐÔ(Referential integrity)ºÍÍâ¼ü(foreign key)
²ÎÕÕÍêÕûÐÔ(Referential integrity)ÊÇÓÃÓÚÔ¼¶¨Á½¸ö¹Øϵ֮¼äµÄÁªÏµ£¬ÀíÂÛÉϹ涨£ºÈôMÊǹØϵSÖеÄÒ»ÊôÐÔ×飬ÇÒMÊÇÁíÒ»¹ØϵZµÄÖ÷¹Ø¼ü×Ö£¬Ôò³ÆMΪ¹ØϵS¶ÔÓ¦¹ØϵZµÄÍâ¹Ø¼ü×Ö¡£ÈôMÊǹØϵSµÄÍâ¹Ø¼ü×Ö£¬ÔòSÖÐÿһ¸öÔª×éÔÚMÉϵÄÖµ±ØÐëÊÇ¿ÕÖµ»òÊǶÔÓ¦¹ØϵZÖÐij¸öÔª×éµÄÖ÷¹ ......
1¡¢mysql Êý¾Ý¿âûÓÐÔöÁ¿±¸·ÝµÄ»úÖÆ£¬µ±Êý¾ÝÁ¿Ì«´óµÄʱºò±¸·ÝÊÇÒ»¸öºÜ´óµÄÎÊÌâ¡£»¹ºÃ mysql Êý¾Ý¿âÌṩÁËÒ»ÖÖÖ÷´Ó±¸·ÝµÄ»úÖÆ£¬Æäʵ¾ÍÊÇ°ÑÖ÷Êý¾Ý¿âµÄËùÓеÄÊý¾Ýͬʱдµ½±¸·ÝÊý¾Ý¿âÖС£ÊµÏÖ mysql Êý¾Ý¿âµÄÈȱ¸·Ý¡£
¡¡¡¡2¡¢ÒªÏëʵÏÖË«»úµÄÈȱ¸Ê×ÏÈÒªÁ˽âÖ÷´ÓÊý¾Ý¿â·þÎñÆ÷µÄ°æ±¾µÄÐèÇó¡£ÒªÊµÏ ......
½øÈëcmd
===================
1.µ¼³öÊý¾Ý¿â£¨sql½Å±¾£©
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u root -p db_name > test_db.sql
¡¡¡¡2.mysqlµ¼³öÊý¾Ý¿âÒ ......
1. ÓÃcmd½øÈëmysql/binĿ¼
2. ÊäÈëmysqld-nt --skip-grant-tables
3. ÐÂÆôcmd ÊäÈëmysqladmin -u root flush-privileges password root
4. mysqladmin -u root -p shutdown
5. ÊäÈëеÄÃÜÂ룺XXX
6.ÐÞ¸ÄÃÜÂë³É¹¦ ......