MySQL µÄ´¥·¢Æ÷¡¢´æ´¢¹ý³Ì¡¢º¯Êý¡¢ÊÓͼʵÑé
±¾ÊµÑéÍê³ÉÈçϽá¹û£º
0. testÊý¾Ý¿â,userinfo Óû§ÐÅÏ¢±í ºÍ userinfolog Óû§ÐÅÏ¢ÈÕÖ¾±í
1. ½¨Á¢Ò»¸öuserinfo±íÐÂÔö¼Ç¼ʱµÄ´¥·¢Æ÷,½«ÐÂÔöÈÕÖ¾¼ÓÈëµ½userinfolog
2. ½¨Á¢Ò»¸öÏòuserinfo±íÐÂÔö¼Ç¼µÄ´æ´¢¹ý³Ì
3. ¸ù¾Ýuserinfo±íµÄ³öÉúÈÕÆÚ×Ö¶Î,ÎÒÃǽ«½¨Á¢Ò»¸ö¼òµ¥ËãµÃÄêÁäµÄ×Ô¶¨Ò庯Êý
4. ´´½¨Ò»¸öuserinfoµÄÊÓͼ,µ÷ÓÃÄêÁ亯Êý
0.×¼±¸Ïà¹Ø±í
mysql> use test;
mysql> create table userinfo(userid int,username varchar(10),userbirthday date);
mysql> create table userinfolog(logtime datetime,loginfo varchar(100));
mysql> describe userinfo;
1.´¥·¢Æ÷
mysql> delimiter |
mysql> create trigger beforeinsertuserinfo
-> before insert on userinfo
-> for each row begin
-> insert into userinfolog values(now(),CONCAT(new.userid,new.username));
-> end;
-> |
mysql> delimiter ;
mysql> show triggers;
2.´æ´¢¹ý³Ì
mysql> delimiter //
mysql> create procedure spinsertuserinfo(puserid int,pusername varchar(10),puserbirthday date)
-> begin
-> insert into userinfo values(puserid,pusername,puserbirthday);
-> end;
-> //
mysql> show procedure status like 'spinsertuserinfo';
mysql> call spinsertuserinfo(1,'zhangsan',current_date);
&n
Ïà¹ØÎĵµ£º
fedora8 ÓÃyumÀ´¹ÜÀí°²×°Apache+PHP+MysqlµÄ»ù±¾°²×°¡£
1. °²×°Apahce, PHP, Mysql, ÒÔ¼°phpÁ¬½Ómysql¿â×é¼þ¡£
yum -y install httpd php mysql mysql-server php-mysql
2. ÅäÖÿª»úÆô¶¯·þÎñ
/sbin/chkconfig httpd on [ÉèÖÃapache·þÎñÆ÷httpd·þÎñ¿ª»úÆô¶¯]
......
The MySQL 5.0 Archive Storage Engine
http://dev.mysql.com/tech-resources/articles/storage-engine.html
ÌØµã£º
1.²»Ö§³ÖÈκÎË÷Òý£¬µ«Ê¹Óòéѯ»º´æ
2.¸ù¾Ýmysql¹¤³ÌʦµÄ˵·¨£¬µ±±í´óС´ïµ½1.5Gʱ£¬±íɨÃèarchiveʱ¼äÉÙÓÚmyisam±í
3.Èç¹ûÄãÏë¸Ä±äÆäËû´æ´¢ÒýÇæµÄ±íµ½archiveÒýÇæ£¬ÇëÏÈdropÏÂÈκÎË÷Òý
4.myisam¿ÉÒÔÓ ......
package com.lovo.cq.shopping10_1.common;
import java.sql.*;
public class DbUtil {
private PreparedStatement pstmt = null;
private Connection con = null;
public DbUtil() {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://l ......