mysql´æÖü¹ý³Ì
## **********first test,procedure**********
#<1>
use testprocedure;
delimiter //
create procedure simpleproce1 (out par1 int)
begin
select count(*) into par1 from proce;
end
//
delimiter ;
call simpleproce1(@a);
select @a;
#<2>,ÿ´ÎÖ»Óе¥Ò»µÄÐпÉÒÔ±»È¡»Øselect id,name into par1,par2 from proce LIMIT 1;ÖеÄLIMIT 1;
use testprocedure;
delimiter //
DROP procedure IF EXISTS simpleproce2
create procedure simpleproce2 (out par1 int,out par2 char(30))
begin
select id,name into par1,par2 from proce LIMIT 1;
end
//
delimiter ;
call simpleproce2(@a,@b);
select @a,@b;
## *********second test,function************
#<3>
delimiter //
DROP FUNCTION IF EXISTS hello
//
create function hello(s char(20)) returns char(50)
return concat('Hello, ',s,'!');
//
delimiter ;
select hello('world');
show create function testprocedure.hello\G
#Ëü·µ»Ø×Ó³ÌÐòµÄÌØÕ÷£¬ÈçÊý¾Ý¿â£¬Ãû×Ö£¬ÀàÐÍ£¬´´½¨Õß¼°´´½¨ºÍÐÞ¸ÄÈÕÆÚ
show function status like 'hello'\G
#<4>
#×¢Òâname²»ÄܺÍ×Ö¶ÎÃûÏàͬ
delimiter //
DROP procedure IF EXISTS test //
CREATE PROCEDURE test ()
BEGIN
DECLARE name VARCHAR(5) DEFAULT 'bob';
DECLARE newname VARCHAR(5);
DECLARE xid INT;
SELECT name,id INTO newname,xid
from proce WHERE name = name;
SELECT newname;
END;
//
call test1() //
#***
delimiter //
DROP procedure IF EXISTS test2 //
CREATE PROCEDURE test2 ()
BEGIN
DECLARE newname VARCHAR(5);
DECLARE xid INT;
SELECT name,id INTO newname,xid
from proce limit 1;
SELECT newname,xid;
END;
//
call test2() //
#<5>
use testprocedure;
CREATE PROCEDURE p1 () SELECT * from proce;
call p1();
#<6>×¢Òâ´Ë´¦µÄhandl
Ïà¹ØÎĵµ£º
Ê×ÏÈÐèҪжÔØredhat×Ô´øµÄmysqlÊý¾Ý¿â£¨²»È»°²×°Ê±»á³öÎÊÌ⣩
rpm -qa|grep mysql
È»ºó rpm -e °üÃû³Æ
Èç¹ûÉæ¼°µ½ÒÀÀµ£¬¾ÍÏÈɾ³ýÒÀÀµ£¬»òÕß¼Ó¸ö -nodeps ²ÎÊýºöÂÔÒÀÀµ
ÓÐÍøÓÑ˵ÓÃyum -y remove mysqlÒ²¿ÉÒÔ
ÁíÒ»¸ö½â¾ö·½·¨Ê±ÔÚlinux×Ô´ømysql»ù´¡ÉÏÔÙװеÄmysql
¶þ½øÖÆ°²×°°ü°æ±¾ºÜ¶à£¬³£ÓõľÍÁ½¸ö£¬ÎÒϵÄÊÇ ......
´Ë³ÌÐòʵÏÖ½«mysqlÊý¾Ý¿âµÄģʽÐÅϢչʾ³öÀ´¡£ÏÂÃæÎÒ¼òÒªµØ˵Ã÷һϡ£
1.Ê÷ÐνṹµÄʵÏÖ¡£
SimplePanel pl=new SimplePanel();
private void buildFrameLayout(){
try{ pane = getContentPane();
//¹Ø±ÕÃæ°å
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//BorderLayout²¼¾Ö¹ÜÀíÆ÷
JPanel ......
1¡¢ÏÂÔØMySQLµÄ°²×°Îļþ
°²×°MySQLÐèÒªÏÂÃæÁ½¸öÎļþ£º
MySQL-server-5.0.46.i386.rpm¡¡¡¡¡¡
MySQL-client-5.0.46.i386.rpm
2¡¢°²×°MySQL
rpmÎļþÊÇRed Hat¹«Ë¾¿ª·¢µÄÈí¼þ°²×°°ü£¬rpm¿ÉÈÃLinuxÔÚ°²×°Èí¼þ°üʱÃâ³ýÐí¶à¸´ÔÓµÄÊÖÐø¡£¸ÃÃüÁîÔÚ°²×°Ê±³£ÓõIJÎÊýÊÇ
ivh
,ÆäÖÐi±íʾ½«°²×°Ö¸¶¨µÄrmpÈí¼þ°ü£¬V±í ......
Oracleº¯ÊýºÍmysqlº¯Êý±È½Ï
1. OracleÖеÄto_number()ת»»³ÉÊý×Ö£»
Oracle> Select to_number(‘123’) from dual; ----- 123;
&nbs ......
MySQLµÄ±¸·Ý·½Ê½£¬Ä¿Ç°ÎÒÏëµ½µÄÓÐÎåÖÖ£¬ÓпÉÄÜ»¹ÓÐ
1£¬mysqldump·½Ê½£¬¼ÓÉϾßÌå²ÎÊýÃû£¨µ¥¿â£¬¶à¿â£¬´¥·¢Æ÷£¬´æ´¢¹ý³Ì£¬±í½á¹¹£¬×Ö·û¼¯£¬–single-transaction£¬µÈµÈ£©
2£¬mysqlhotcopy Ö»Äܱ¸·ÝmyisamÊý¾Ý±í±¸·Ý£¬ËÙ¶ÈÏ൱¿ì£¬ÒòΪÊÇÎļþ¿½±´£¬¿ÉÄÜ˲¼ä±»Ëø±í£¬ÈκεÄÊý¾Ý²Ù×÷£¬±ÈÈç²åÈëºÍ¸üж¼»á¹ÒÆð¡£
3£¬LVMµ ......