MySQLÁ¬½Óʱ¿ìʱÂýµÄÎÊÌâ½â¾ö
my.iniÀïµÄÄǸötmp_table_sizeµÄÖµ.ÔÀ´tmp_table_size=16M.ÎÒ¸ÄΪ32M
È»ºóÖØÆôMYSQL»¹ÊÇû½â¾öÎÊÌâ.
Ö»ºÃÖØÆô·þÎñÆ÷ÊÔÊÔÁË,½á¹ûÖØÆôºóCPUÕý³£ÁË.²»¹ý»¹ÊÇûÕÒ³öÊÇʲôÔÒòµ¼ÖÂMYSQLÕ¼ÓÃÄÇô¶àCPU×ÊÔ´.
=====================================
ÐÞ¸ÄhostsÎļþ£¬¼ÓÈëÒ»ÐÐ
172.16.59.12 abc
Ð޸ijɹ¦ÒÔºóping abcÓ¦¸ÃÓзµ»Ø
ÒÔºóÖ±½ÓÔÚ³ÌÐòÖÐÓÃabcÁ¬½ÓÊý¾Ý¿â£¬²»ÒªÓÃ172.16.59.12
=====================================
my.cnfÀïÐÞ¸ÄÅäÖ㬽ûÓÃDNS·´Ïò½âÎö£º
[mysqld]
skip-name-resolve
skip-grant-tables
²¹³ä--skip-name-resolveÕâ¸öÑ¡ÏîµÄ×÷Óãº
mysql¿Í»§¶Ëÿ´Î·ÃÎÊdb£¬mysql¾Í»áÊÔͼȥ½âÎöÀ´·ÃÎʵĻúÆ÷µÄhostname£¬²¢»º´æµ½hostname cache£¬Èç¹ûÕâʱ½âÎö²»ÁË£¬µÈÒ»¶Îʱ¼ä»áʧ°Ü£¬Êý¾Ý²ÅÄܱ»È¡¹ýÀ´¡£
ÈôʹÓÖskip-grant-tablesϵͳ½«¶ÔÈκÎÓû§µÄ·ÃÎʲ»×öÈκηÃÎÊ¿ØÖÆ£¬µ«¿ÉÒÔÓà mysqladmin flush-privileges»òmysqladmin reloadÀ´¿ªÆô·ÃÎÊ¿ØÖÆ;ĬÈÏÇé¿öÊÇshow databasesÓï¾ä¶ÔËùÓÐÓû§¿ª·Å£¬
Èç¹ûmysql·þÎñÆ÷ûÓпªÔ¶³ÌÕÊ»§£¬¾ÍÔÚmy.iniÀïÃæ¼ÓÉÏskip-grant-tables
=====================================
Ôڸ߲¢·¢¸ßÁ÷Á¿µÄÇé¿öÏ£¬»ùÓÚÊý¾Ý¿âÇý¶¯µÄÓ¦ÓÃϵͳºÜÈÝÒ׳öÏÖÆ¿¾±£¬Õâ¸öÆ¿¾±Ê×ÏȾÍÊÇmax_connections£¬¼´Êý¾Ý¿âµÄͬʱ×î´óÁ¬½ÓÊý.ÔÚMySQL°²×°µÄʱºòĬÈÏÖ»ÓÐ100¸ö¡£Ôö´óÕâ¸öÁ¬½ÓÊýÄÜÂíÉÏÆðµ½Ð§¹û¡£µ«ÊDz¢²»ÊÇÄÜÎÞÏÞÁ¿Ôö¼Ó£¬ÎÒÔÚwindow·þÎñÆ÷ϺÍlinux·þÎñÆ÷Ï·ֱð×öÁËʵÑé¡£
=====================================
ÐÞ¸Ämy.cnf
1. ×¢Ê͵ô # skip-networking
2. ¸øMYSQL°ó¶¨IP bind-address = 123.45.67.89 # server IP address
=====================================
ÎÊÌâµÄ³öÏÖÊÇÕâÑùµÄ£¬ÎÒµÄÒ»¸öwebÓ¦ÓÃÖÐÓÐÒ»¸öÁбíÒ³Ã棬Óöµ½ÁËn+1ÎÊÌ⣬¾ÍÊÇ´ò¿ªÕâ¸öÒ³Ã棬ÁбíÖÐÓÐnÌõÐÅÏ¢£¬¾Í»á²úÉún+1Ìõsql¡£´ò¿ªÕâ¸öÒ³ÃæºÜÂý£¬ÐèÒª1·ÖÖӶࡣȻ¶ø£¬Õâ¸öÎÊÌâÖ»ÔÚ²âÊÔ»·¾³³öÏÖ£¬Éú²ú»·¾³ºÍ±¾µØ¿ª·¢»·¾³¾ùΪ³öÏÖ´ËÎÊÌâ¡£
¾¹ý¸ú×ٺͷÖÎö£¬·¢ÏÖÎÊÌâ³öÔÚ»ñÈ¡Á¬½ÓµÄʱºò£¬ÓÉÓÚûÓÐʹÓÃÁ¬½Ó³Ø£¬Õân+1Ìõsql£¬¾³£¾Í»áÓöµ½»ñÈ¡Á¬½ÓÂýµÄ¡£ÈçÏÂΪÈÕÖ¾£º
2009-11-23 13:41:20,679 INFO [Test] - -----------config------------
2009-11-23 13:41:20,695 INFO [Test] - url: jdbc:mysql://88.88.88.88:3306/xxxdatabase?useUnic
Ïà¹ØÎĵµ£º
ÕâÀï½éÉÜÒ»¸ö¼¯³É»·¾³ XAMPP¡£
XAMPP ÊÇÒ»¸öÒ×ÓÚ°²×°ÇÒ°üº¬ MySQL¡¢PHP ºÍ Perl µÄ Apache ·¢Ðа档XAMPP µÄÈ··Ç³£ÈÝÒ×°²×°ºÍʹÓãºÖ»ÐèÏÂÔØ£¬½âѹËõ£¬Æô¶¯¼´¿É¡£
ÏÂÔصØÖ·£º
http://www.apachefriends.org/zh_cn/xampp.html
µ½Ä¿Ç°ÎªÖ¹£¬XAMPP ¹²ÓÐÒÔÏÂËÄÖÖ°æ±¾£º
£¨1£©ÊÊÓÃÓÚ Linux µÄ XAMPP
£¨2£©ÊÊÓÃÓÚ Windows µ ......
mysql½Ì³Ì:¸ßÊÖÊÇÔõÑùÁ¶³ÉµÄ:¾«ÃîSQLÓï¾ä½éÉÜ
[ÈÕÆÚ£º2009-06-02] À´Ô´£º ×÷Õߣº
ÈçºÎ´Óһλ²ËÄñÍɱä³ÉΪ¸ßÊÖ£¬Áé»îʹÓõÄSQLÓï¾äÊDZز»¿ÉÉٵġ£±¾ÎÄÊÕ¼¯Á˲¿·Ö±È½Ï¾µä£¬³£ÓõÄSQLÓï¾ä¹©´ó¼Ò²Î¿¼£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
¡¡¡¡ËµÃ÷£º¸´ÖƱí(Ö»¸´Öƽṹ,Ô´±íÃû£ºa бíÃû£ºb)¡¡¡¡
¡¡¡¡SQL: select * into ......
//Ö÷¼ü
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//Ôö¼ÓÒ»¸öÐÂÁÐ
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default '0';
//ɾ³ýÁÐ
alter table t2 drop column c;
//ÖØÃüÃûÁÐ
......
¾³£Óõ½£¬µ«ÊÇ×ÜÊǼDz»×¡¡£
Óï·¨ÈçÏ£º
ALTER TABLE JOB ADD CONSTRAINT fk_prono
FOREIGN KEY(PRONO)
REFERENCES PROJECT(PRONO)
ON DELETE CASCADE
ON UPDATE NO ACTION;
ÎÒÔÚmysqlÖÐÌí¼ÓÁËÍâ¼üÔ¼Êø£¬ÊÔÁË°ëÌìû³É¹¦£¬ºóÀ´°ÑÍâ¼üµÄÃû×ÖÓÉFK¸Ä³ÉFK_1¾ÍºÃÁË£¬¿ÉÄÜmysqlÖÐFKÊǸö±£Áô×Ö£¬×¢Ò⣡ ......
ºÜ¾ÃûÓÐÓÃMysqlÁË£¬·¢ÏÖССµÄʱ¼äÎÊÌâÒ²Óöµ½²»ÉÙÂé·³£¬ºÇºÇ
ËùÒÔ×ܽáһϣº
µÚÒ»ÖÖ:
Date time= new java.sql.Date(new java.util.Date().getTime());
µÚ¶þÖÖ:
java ÓÃPreparedStatementÀ´setDate,ÓÃÎʺŵÄÐÎʽ¸øÈÕÆÚÎʺŸ³Öµ
pstmt.setTimestamp(8, new Timestamp(System.currentTimeMillis()));
pst ......