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

Struts+Hibernate+MySqlÖÐÎÄÂÒÂë½â¾ö·½°¸

1¡¢ÐÞ¸ÄMySqlÊý¾Ý¿âµÄmy.iniÅäÖÃÎļþ¡¢
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
port=3306
default-character-set=GBK
#´Ë´¦Ä¬ÈϱàÂëÐÞ¸ÄΪGBK»òutf-8
# SERVER SECTION
# ----------------------------------------------------------------------
#
2¡¢´´½¨Êý¾Ý±íµÄʱºò
# Ö÷»ú: localhost
# Êý¾Ý¿â: cits
# ±í: 'article'
#
CREATE TABLE `article` (
  `article_id` varchar(100) NOT NULL default '0',
  `article_title` varchar(100) default NULL,
  `domain_id` varchar(100) default NULL,
  `article_text` varchar(100) default '',
  `good_flg` tinyint(1) default NULL,
  `lock_flg` tinyint(1) default NULL,
  `top_flg` tinyint(1) default NULL,
  `read_times` int(11) default NULL,
  `reply_times` int(11) default NULL,
  `last_reply` char(6) default NULL,
  `last_reply_time` datetime default NULL,
  `add_user` varchar(30) default NULL,
  `add_date` datetime default NULL,
  `upd_user` varchar(30) default NULL,
  `upd_date` datetime default NULL,
  PRIMARY KEY  (`article_id`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk;
´Ë´¦ÒªÓÃGBK±àÂë
 
3¡¢ÔÚjspÒ³ÃæÖÐʹÓÃUTF-8±àÂë
<%
Object init = request.getAttribute("init");
String domainId = (String)request.getAttribute("domainId");
if ((init == null) || (init.equals("")) || (init.equals("null"))) {
 response.sendRedirect("./listArticle.do?domainId="+domainId);
} else {
%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import ="java.util.HashMap"%>
<%@ page import ="java.util.List"%>
<%@ page impo


Ïà¹ØÎĵµ£º

mysqlµÄgrantÃüÁî

¹Ø¼ü×Ö: mysql grant
±¾ÎÄʵÀý£¬ÔËÐÐÓÚ MySQL 5.0 ¼°ÒÔÉϰ汾¡£
MySQL ¸³ÓèÓû§È¨ÏÞÃüÁîµÄ¼òµ¥¸ñʽ¿É¸ÅÀ¨Îª£º
grant ȨÏÞ on Êý¾Ý¿â¶ÔÏó to Óû§
Ò»¡¢grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû¡£
grant select on testdb.* to common_user@'%'
grant insert on testdb.* to common_user ......

СÌâ´ó×öÖ®MySQL 5.0´æ´¢¹ý³Ì±à³ÌÈëÃÅ

MySQL °æ±¾£º5.0.45    phpMyAdmin°æ±¾£º2.11.3
 
Ê×ÏÈ¿´MySQL 5.0²Î¿¼ÊÖ²áÖйØÓÚ´´½¨´æ´¢¹ý³ÌµÄÓ﷨˵Ã÷£º
 
CREATE
    [DEFINER = { user | CURRENT_USER }]
    PROCEDURE sp_name ([proc_parameter[,...]])
    [characteristic ...] r ......

Mysql²éѯ·ÖÒ³

˵Ã÷£ºÕâÊÇÒ»¸öʵÀý£¬ÆäÖÐÓÐЩ¶«Î÷ÊÇ¿ÉÒÔ³éÈ¡³öÀ´µÄ£¬×÷Ϊһ¸ö¹«¹²µÄ·½·¨£¬¿ÉÊÇʵÏÖ¸´ÓÃ
public class TestService {
public static TestService test=null;
public static TestService getTestService(){
if(test==null){
test=new TestService();
}
return test;
}
public List getTest(int pageNo ......

mysql replication


<!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;
mso-font-alt:"Courier New";
mso-font-charset:0;
mso-generic-font-family:modern;
mso-font-format:other;
mso-font-pitch:fixed;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{f ......

MysqlÖÐcount(*),DISTINCTµÄʹÓ÷½·¨ºÍЧÂÊÑо¿

ÔÚ´¦ÀíÒ»¸ö´óÊý¾ÝÁ¿Êý¾Ý¿âµÄʱºò
ͻȻ·¢ÏÖmysql¶ÔÓÚcount(*)µÄ²»Í¬´¦Àí»áÔì³É²»Í¬µÄ½á¹û
±ÈÈçÖ´ÐÐ
SELECT count(*) from tablename
¼´Ê¹¶ÔÓÚǧÍò¼¶±ðµÄÊý¾ÝmysqlÒ²Äܷdz£Ñ¸Ëٵķµ»Ø½á¹û
¶ø¶ÔÓÚ
SELECT count(*) from tablename WHERE…..
mysqlµÄ²éѯʱ¼ä¿ªÊ¼ÅÊÉý
×Ðϸ²éÔÄÀÛÏÂÊÖ²á,·¢ÏÖµ±Ã»ÓÐWHEREÓï¾ä¶ÔÓÚÕ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ