MySQLʵÏÖÊ÷µÄ±éÀú
¾³£ÔÚÒ»¸ö±íÖÐÓи¸×Ó¹ØϵµÄÁ½¸ö×ֶΣ¬±ÈÈçempnoÓëmanager£¬ÕâÖֽṹÖÐÐèÒªÓõ½Ê÷µÄ±éÀú¡£ÔÚOracle ÖпÉÒÔʹÓÃconnect by¼òµ¥½â¾öÎÊÌ⣬²Î¼ûhttp://blog.csdn.net/wzy0623/archive/2007/06/18/1656345.aspx£¬µ«MySQL 5.1Öл¹²»Ö§³Ö£¨¾Ý˵ÒÑÄÉÈëto doÖУ©£¬Òª×Ô¼ºÐ´¹ý³Ì»òº¯ÊýÀ´ÊµÏÖ¡£
Ò»¡¢½¨Á¢²âÊÔ±íºÍÊý¾Ý£º
DROP TABLE IF EXISTS `channel`;
CREATE TABLE `channel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cname` varchar(200) DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
/*Data for the table `channel` */
insert into `channel`(`id`,`cname`,`parent_id`)
values (13,'Ê×Ò³',-1),
(14,'TV580',-1),
(15,'Éú»î580',-1),
(16,'×óÉϻõÆƬ',13),
(17,'°ïæ',14),
(18,'À¸Ä¿¼ò½é',17);
¶þ¡¢ÀûÓÃÁÙʱ±íºÍµÝ¹é¹ý³ÌʵÏÖÊ÷µÄ±éÀú£¨mysqlµÄUDF²»Äܵݹéµ÷Óã©£º
DELIMITER $$
USE `db1`$$
-- ´Óij½ÚµãÏòϱéÀú×Ó½Úµã
-- µÝ¹éÉú³ÉÁÙʱ±íÊý¾Ý
DROP PROCEDURE IF EXISTS `createChildLst`$$
CREATE PROCEDURE `createChildLst`(IN rootId INT,IN nDepth INT)
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE b INT;
DECLARE cur1 CURSOR FOR SELECT id from channel WHERE parent_id=rootId;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET max_sp_recursion_depth=12;
INSERT INTO tmpLst VALUES (NULL,rootId,nDepth);
OPEN cur1;
FETCH cur1 INTO b;
WHILE done=0 DO
CALL createChildLst(b,nDepth+1);
FETCH cur1 INTO b;
END WHILE;
CLOSE cur1;
END$$
-- ´Óij½ÚµãÏòÉÏ×·Ëݸù½Úµã
-- µÝ¹éÉú³ÉÁÙʱ±íÊý¾Ý
DROP PROCEDURE IF EXISTS `createParentLst`$$
CREATE PROCEDURE `createParentLst`(IN rootId INT,IN nDepth INT)
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE b INT;
DECLARE cur1 CURSOR FOR SELECT parent_id from channel WHERE id=rootId;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET max_sp_recursion_depth=12;
INSERT INTO tmpLst VALUES
Ïà¹ØÎĵµ£º
¡ñjspÁ¬½ÓMySQLÊý¾Ý¿â
testmysql.jspÈçÏ£º
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String url ="jdbc:mysql://localhost/softforum?
user=soft&pas ......
±¾ÎÄתÔØ×Ô£ºhttp://www.54xue.com/?action-viewnews-itemid-7498
#BEGIN CONFIG INFO
#DESCR: 4GB RAM, ֻʹÓÃInnoDB, ACID, ÉÙÁ¿µÄÁ¬½Ó, ¶ÓÁиºÔØ´ó
#TYPE: SYSTEM
#END CONFIG INFO
#
# ´ËmysqlÅäÖÃÎļþÀý×ÓÕë¶Ô4GÄÚ´æ
# Ö÷ҪʹÓÃINNODB
#´¦Àí¸´ÔÓ¶ÓÁв¢ÇÒÁ¬½ÓÊýÁ¿½ÏÉÙµÄmysql·þÎñÆ÷
#
# ½«´ËÎļþ¸´ÖƵ½/etc/m ......
ÐÞ¸ÄrootÃÜÂëµÄʱºò°´ÕÕÍøÉϵÄ˵µÄ¾ÓȻɵɵµÄÖ´ÐÐÁËupdate user set password="asdf" where user="root"£»Ö´ÐÐÖ®ºó·¢ÏÖÃÜÂë´íÁË£¬½øÈ¥²»ÁË£¬ÓÚÊÇÕÛÌÚÁË°ëÌ죬·¢ÏÖmysqlµÄÃÜÂëÊǼÓÃܵIJ»ÊÇÃ÷ÎÄ´æ´¢µÄ£¬ËùÒԸĵÄʱºòÐèÒªÕâÑùset password=password("asdf")¡£´íÎóÒѾ·¢ÉúÁË£¬ÓÚÊǾͰ´ÕÕÏÂÃæµÄ· ......
ĬÈϵ¼³öµ½µ±Ç°Ä¿Â¼ÖÐ
¡¡¡¡1.µ¼³öÕû¸öÊý¾Ý¿â
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû
¡¡¡¡mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
¡¡¡¡2.µ¼³öÒ»¸ö±í
¡¡¡¡mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû> µ¼³öµÄÎļþÃû
¡¡¡¡mysqldum ......