Ó°ÏìMysqlÐÔÄܵļ¸¸öÖØÒª²ÎÊý˵Ã÷
innodb_buffer_pool_size
Èç¹ûÓÃInnodb£¬ÄÇôÕâÊÇÒ»¸öÖØÒª±äÁ¿¡£Ïà¶ÔÓÚMyISAMÀ´Ëµ£¬Innodb¶ÔÓÚbuffer size¸üÃô¸Ð¡£MySIAM¿ÉÄܶÔÓÚ´óÊý¾ÝÁ¿Ê¹ÓÃĬÈϵÄkey_buffer_sizeÒ²»¹ºÃ£¬µ«InnodbÔÚ´óÊý¾ÝÁ¿Ê±ÓÃĬÈÏÖµ¾Í¸Ð¾õÔÚÅÀÁË¡£ InnodbµÄ»º³å³Ø»á»º´æÊý¾ÝºÍË÷Òý£¬ËùÒÔ²»ÐèÒª¸øϵͳµÄ»º´æÁô¿Õ¼ä£¬Èç¹ûÖ»ÓÃInnodb£¬¿ÉÒÔ°ÑÕâ¸öÖµÉèΪÄÚ´æµÄ70%-80%¡£ºÍ key_bufferÏàͬ£¬Èç¹ûÊý¾ÝÁ¿±È½ÏСҲ²»ÔõôÔö¼Ó£¬ÄÇô²»Òª°ÑÕâ¸öÖµÉèÌ«¸ßÒ²¿ÉÒÔÌá¸ßÄÚ´æµÄʹÓÃÂÊ¡£
innodb_additional_pool_size
Õâ¸öµÄЧ¹û²»ÊǺÜÃ÷ÏÔ£¬ÖÁÉÙÊǵ±²Ù×÷ϵͳÄܺÏÀí·ÖÅäÄÚ´æʱ¡£µ«Äã¿ÉÄÜÈÔÐèÒªÉè³É20M»ò¸ü¶àÒ»µãÒÔ¿´Innodb»á·ÖÅä¶àÉÙÄÚ´æ×öÆäËûÓÃ;¡£
innodb_log_file_size
¶ÔÓÚдºÜ¶àÓÈÆäÊÇ´óÊý¾ÝÁ¿Ê±·Ç³£ÖØÒª¡£Òª×¢Ò⣬´óµÄÎļþÌṩ¸ü¸ßµÄÐÔÄÜ£¬µ«Êý¾Ý¿â»Ö¸´Ê±»áÓøü¶àµÄʱ¼ä¡£ÎÒÒ»°ãÓÃ64M-512M£¬¾ßÌåÈ¡¾öÓÚ·þÎñÆ÷µÄ¿Õ¼ä¡£
innodb_log_buffer_size
ĬÈÏÖµ¶ÔÓÚ¶àÊýÖеÈд²Ù×÷ºÍÊÂÎñ¶ÌµÄÔËÓö¼ÊÇ¿ÉÒԵġ£Èç¹û¾³£×ö¸üлòÕßʹÓÃÁ˺ܶàblobÊý¾Ý£¬Ó¦¸ÃÔö´óÕâ¸öÖµ¡£µ«Ì«´óÁËÒ²ÊÇÀË·ÑÄڴ棬ÒòΪ1ÃëÖÓ×Ü»á flush£¨Õâ¸ö´ÊµÄÖÐÎÄÔõô˵ÄØ£¿£©Ò»´Î£¬ËùÒÔ²»ÐèÒªÉèµ½³¬¹ý1ÃëµÄÐèÇó¡£8M-16MÒ»°ãÓ¦¸Ã¹»ÁË¡£Ð¡µÄÔËÓÿÉÒÔÉè¸üСһµã¡£
innodb_flush_log_at_trx_commit £¨Õâ¸öºÜ¹ÜÓã©
±§Ô¹Innodb±ÈMyISAMÂý 100±¶£¿ÄÇôÄã´ó¸ÅÊÇÍüÁ˵÷ÕûÕâ¸öÖµ¡£Ä¬ÈÏÖµ1µÄÒâ˼ÊÇÿһ´ÎÊÂÎñÌá½»»òÊÂÎñÍâµÄÖ¸ÁÐèÒª°ÑÈÕ־дÈ루flush£©Ó²ÅÌ£¬ÕâÊǺܷÑʱµÄ¡£ÌرðÊÇʹÓõç³Ø¹©µç»º´æ£¨Battery backed up cache£©Ê±¡£Éè³É2¶ÔÓںܶàÔËÓã¬ÌرðÊÇ´ÓMyISAM±íת¹ýÀ´µÄÊÇ¿ÉÒԵģ¬ËüµÄÒâ˼ÊDz»Ð´ÈëÓ²Å̶øÊÇдÈëϵͳ»º´æ¡£ÈÕÖ¾ÈÔÈ»»áÿÃëflushµ½Ó²ÅÌ£¬ËùÒÔÄãÒ»°ã²»»á¶ªÊ§³¬¹ý1-2ÃëµÄ¸üС£Éè³É0»á¸ü¿ìÒ»µã£¬µ«°²È«·½Ãæ±È½Ï²î£¬¼´Ê¹MySQL¹ÒÁËÒ²¿ÉÄܻᶪʧÊÂÎñµÄÊý¾Ý¡£¶øÖµ2Ö»»áÔÚÕû¸ö²Ù×÷ϵͳ¹ÒÁËʱ²Å¿ÉÄܶªÊý¾Ý¡£
Ïà¹ØÎĵµ£º
ºÜ¾ÃûÓÐÓÃMysqlÁË£¬·¢ÏÖССµÄʱ¼äÎÊÌâÒ²Óöµ½²»ÉÙÂé·³£¬ºÇºÇ
ËùÒÔ×ܽáһϣº
µÚÒ»ÖÖ:
Date time= new java.sql.Date(new java.util.Date().getTime());
µÚ¶þÖÖ:
java ÓÃPreparedStatementÀ´setDate,ÓÃÎʺŵÄÐÎʽ¸øÈÕÆÚÎʺŸ³Öµ
pstmt.setTimestamp(8, new Timestamp(System.currentTimeMillis()));
pst ......
Ê×ÏÈÍ£Ö¹MySQL·þÎñ£ºsudo /etc/init.d/mysql stop
È»ºó±à¼MySQLÅäÖÃÎļþ£ºsudo gedit /etc/mysql/my.cnf
ÔÚmy.cnfÎļþÖеÄ[client]¶ÎÏÂÃæ¼ÓÈë
default-character-set=utf8
[mysqld_safe]
default-character-set=utf8
[mysqld]
default-character-set=utf8
[mysql]
default-character-set=utf8
ÖØÐÂÆô¶¯MySQL·þÎñ ......
<?php
/**
* Mysql DB
*
* @author Administrator
* @package defaultPackage
*/
class MySqlDB{
private $_db;
private static $_instance;
private function __construct(&$db_type){
global $connectionstr;
$conn_db=$connectionstr[$db_type];
$this->_db=mysql_pconnect($conn ......
ÓÃÁËMYSQLÒ»Äê¶à£¬ÇÒÒ»Ö±±»MYSQLµÄ¿ìËÙ²éѯËùÎüÒý£¬¿É½ñÌìÔõôÅöʯͷÁË£¿
1Dp4V*W+t0
3p)o{3s.a'^Qr0
ÔÀ´¾ÍÊÇË÷ÒýÔÚ×ö¹Ö¡£ÓÉÓÚ±¾ÈËÊÇÒµÓà°®ºÃ×ÔѧPHP+MYSQL¿ª·¢£¬ËùÒÔÔÚÀíÂÛÓÅ»¯·½ÃæÒ»°ã¿¼ÂÇÉõÉÙ£¬»ù±¾²»ÓÃ×Ö¶ÎË÷ÒýÈ¥×öMYSQLÓÅ»¯£¬¿ÉÄÜÒ²ÊÇÎÒ²»»áÓðɡ££¨×Ü¿´ÊéÉÏ˵Ë÷ÒýµÄºÃ´¦ºÃ´¦µÄ£¬½ñÌì×Åʵ³¢µ½ÌðÍ·ÁË¡££©PHPChi ......
L1¡¢HTML¾²Ì¬»¯
Æäʵ´ó¼Ò¶¼ÖªµÀ£¬Ð§ÂÊ×î¸ß¡¢ÏûºÄ×îСµÄ¾ÍÊÇ´¿¾²Ì¬»¯µÄhtmlÒ³Ã棬ËùÒÔÎÒÃǾ¡¿ÉÄÜʹÎÒÃǵÄÍøÕ¾ÉϵÄÒ³Ãæ²É Óþ²Ì¬Ò³ÃæÀ´ÊµÏÖ£¬Õâ¸ö×î¼òµ¥µÄ·½·¨ÆäʵҲÊÇ×îÓÐЧµÄ·½·¨¡£µ«ÊǶÔÓÚ´óÁ¿ÄÚÈݲ¢ÇÒƵ·±¸üеÄÍøÕ¾£¬ÎÒÃÇÎÞ·¨È«²¿ÊÖ¶¯È¥°¤¸öʵÏÖ£¬ÓÚÊdzöÏÖÁËÎÒÃdz£¼ûµÄÐÅÏ¢ ·¢²¼ÏµÍ³CMS£¬ÏñÎÒÃdz£·ÃÎʵĸ÷¸öÃÅ»§Õ¾µãµÄÐ ......