MySQLÐÔÄÜÓÅ»¯
ÔÚApache, PHP, MySQLµÄÌåϵ¼Ü¹¹ÖУ¬MySQL¶ÔÓÚÐÔÄܵÄÓ°Ïì×î´ó£¬Ò²ÊǹؼüµÄºËÐIJ¿·Ö¡£¶ÔÓÚDiscuz!ÂÛ̳³ÌÐòÒ²ÊÇÈç´Ë£¬MySQLµÄÉèÖÃÊÇ·ñºÏÀíÓÅ»¯£¬Ö±½ÓÓ°Ïìµ½ÂÛ̳µÄËٶȺͳÐÔØÁ¿£¡Í¬Ê±£¬MySQLÒ²ÊÇÓÅ»¯ÄѶÈ×î´óµÄÒ»¸ö²¿·Ö£¬²»µ«ÐèÒªÀí½âһЩMySQLרҵ֪ʶ£¬Í¬Ê±»¹ÐèÒª³¤Ê±¼äµÄ¹Û²ìͳ¼Æ²¢ÇÒ¸ù¾Ý¾Ñé½øÐÐÅжϣ¬È»ºóÉèÖúÏÀíµÄ²ÎÊý¡£
ÏÂÃæÎÒÃÇÁ˽âÒ»ÏÂMySQLÓÅ»¯µÄһЩ»ù´¡£¬MySQLµÄÓÅ»¯ÎÒ·ÖΪÁ½¸ö²¿·Ö£¬Ò»ÊÇ·þÎñÆ÷ÎïÀíÓ²¼þµÄÓÅ»¯£»¶þÊÇMySQL×ÔÉí(my.cnf)µÄÓÅ»¯¡£
(1) ·þÎñÆ÷Ó²¼þ¶ÔMySQLÐÔÄܵÄÓ°Ïì
a) ´ÅÅÌÑ°µÀÄÜÁ¦£¨´ÅÅÌI/O£©,ÒÔÄ¿Ç°¸ßתËÙSCSIÓ²ÅÌ(7200ת/Ãë)ΪÀý£¬ÕâÖÖÓ²ÅÌÀíÂÛÉÏÿÃëÑ°µÀ7200´Î£¬ÕâÊÇÎïÀíÌØÐÔ¾ö¶¨µÄ£¬Ã»Óа취¸Ä±ä¡£ MySQLÿÃëÖÓ¶¼ÔÚ½øÐдóÁ¿¡¢¸´ÔӵIJéѯ²Ù×÷£¬¶Ô´ÅÅ̵ĶÁдÁ¿¿ÉÏë¶øÖª¡£ËùÒÔ£¬Í¨³£ÈÏΪ´ÅÅÌI/OÊÇÖÆÔ¼MySQLÐÔÄܵÄ×î´óÒòËØÖ®Ò»£¬¶ÔÓÚÈÕ¾ù·ÃÎÊÁ¿ÔÚ100ÍòPVÒÔÉϵÄDiscuz!ÂÛ̳£¬ÓÉÓÚ´ÅÅÌI/OµÄÖÆÔ¼£¬MySQLµÄÐÔÄÜ»á·Ç³£µÍÏ£¡½â¾öÕâÒ»ÖÆÔ¼ÒòËØ¿ÉÒÔ¿¼ÂÇÒÔϼ¸ÖÖ½â¾ö·½°¸£º
ʹÓÃRAID-0+1´ÅÅÌÕóÁУ¬×¢Òâ²»Òª³¢ÊÔʹÓÃRAID-5£¬MySQLÔÚRAID-5´ÅÅÌÕóÁÐÉϵÄЧÂʲ»»áÏñÄãÆÚ´ýµÄÄÇÑù¿ì£» Å×Æú´«Í³µÄÓ²ÅÌ£¬Ê¹ÓÃËٶȸü¿ìµÄÉÁ´æʽ´æ´¢É豸¡£¾¹ýDiscuz!¹«Ë¾¼¼Êõ¹¤³ÌµÄ²âÊÔ£¬Ê¹ÓÃÉÁ´æʽ´æ´¢É豸¿É±È´«Í³Ó²ÅÌËٶȸ߳ö6£10±¶×óÓÒ¡£
b) CPU ¶ÔÓÚMySQLÓ¦Óã¬ÍƼöʹÓÃS.M.P.¼Ü¹¹µÄ¶à·¶Ô³ÆCPU£¬ÀýÈ磺¿ÉÒÔʹÓÃÁ½¿ÅIntel Xeon 3.6GHzµÄCPU¡£
c) ÎïÀíÄÚ´æ¶ÔÓÚһ̨ʹÓÃMySQLµÄDatabase ServerÀ´Ëµ£¬·þÎñÆ÷Äڴ潨Ò鲻ҪСÓÚ2GB£¬ÍƼöʹÓÃ4GBÒÔÉϵÄÎïÀíÄÚ´æ¡£
(2) MySQL×ÔÉíÒòËص±½â¾öÁËÉÏÊö·þÎñÆ÷Ó²¼þÖÆÔ¼ÒòËغó£¬ÈÃÎÒÃÇ¿´¿´MySQL×ÔÉíµÄÓÅ»¯ÊÇÈçºÎ²Ù×÷µÄ¡£¶ÔMySQL×ÔÉíµÄÓÅ»¯Ö÷ÒªÊǶÔÆäÅäÖÃÎļþmy.cnfÖеĸ÷Ïî²ÎÊý½øÐÐÓÅ»¯µ÷Õû¡£ÏÂÃæÎÒÃǽéÉÜһЩ¶ÔÐÔÄÜÓ°Ïì½Ï´óµÄ²ÎÊý¡£
ÓÉÓÚmy.cnfÎļþµÄÓÅ»¯ÉèÖÃÊÇÓë·þÎñÆ÷Ó²¼þÅäÖÃϢϢÏà¹ØµÄ£¬Òò¶øÎÒÃÇÖ¸¶¨Ò»¸ö¼ÙÏëµÄ·þÎñÆ÷Ó²¼þ»·¾³£º
CPU: 2¿ÅIntel Xeon 2.4GHz
ÄÚ´æ: 4GB DDR
Ó²ÅÌ: SCSI 73GB
ÏÂÃ棬ÎÒÃǸù¾ÝÒÔÉÏÓ²¼þÅäÖýáºÏÒ»·ÝÒѾÓÅ»¯ºÃµÄmy.cnf½øÐÐ˵Ã÷£º
# vi /etc/my.cnf
ÒÔÏÂÖ»Áгömy.cnfÎļþÖÐ[mysqld]¶ÎÂäÖеÄÄÚÈÝ£¬ÆäËû¶ÎÂäÄÚÈݶÔMySQLÔËÐÐÐÔÄÜÓ°ÏìÉõ΢£¬Òò¶ø¹ÃÇÒºöÂÔ¡£
[mysqld]
port = 3306
serverid = 1
socket = /tmp/mysql.sock
skip-locking
# ±ÜÃâMySQLµÄÍⲿËø¶¨£¬¼õÉÙ³ö´í¼¸ÂÊÔöÇ¿Îȶ¨ÐÔ¡£
skip-name-resolve
½ûÖ¹MySQL¶ÔÍⲿÁ¬½Ó½øÐÐDNS½âÎö£¬Ê¹
Ïà¹ØÎĵµ£º
»ù±¾µÄMySQLÓï¾äºÜ¼òµ¥£¬ÕâÀïÖ÷Ҫ̸̸һЩÈÝÒ×ÒÅÍüµÄ¡£
1.ÈçºÎÉèÖÃ×ֶεÝÔö
create table tb_User(Id int auto_increment
not null primary key,UserName varchar(50),Password varchar(20));
2.²é¿´±í½á¹¹
desc tb_User;
3.ÈçºÎÐ޸ıí½á
ÖØÃüÃû±í£ºalter table tb_User rename
tb_UserInfo;
Ìí¼ÓÒ»ÁУºalter ta ......
1.´ÓWindowsÃüÁîÐÐÆô¶¯MySQL
ÒªÏë´ÓÃüÁîÐÐÆô¶¯mysqld·þÎñÆ÷£¬ÄúÓ¦µ±Æô¶¯¿ØÖÆ̨´°¿Ú(»ò“DOS window”)²¢ÊäÈëÃüÁ
¡¡¡¡C£º\> C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld
¡¡¡¡¸ù¾ÝϵͳÖÐMySQL°²×°Î»ÖõIJ»Í¬£¬Ç°ÃæµÄÀý×ÓÖÐʹÓõÄ·¾¶Ò²²»Í¬¡£
¡¡¡¡ÔÚ·ÇNT°æ±¾µÄWindowsÖУ¬ÔÚºǫ́Æô¶¯mysqld¡£Ò² ......
mysql server4.0.18
Åú´¦ÀíÎļþÃûΪdbBackup.bat
ÄÚÈÝ£ºrem ÅжÏmysql·þÎñÊÇ·ñÆô¶¯£¬È»ºó½«²éѯ½á¹ûÊä³öµ½server.logÎļþÀï
netstat -na | (find "0.0.0.0:3306" & find "LISTENING")>server.log
rem ÊÖ¹¤½¨Á¢Ò»¸ö¿ÕµÄÎļþtemp.log£¬ÎªÁ˺Íserver.logÎļþÏà±È½Ï
rem ½«server.logÓëtemp.logÏà±È½Ï£¬Èç¹ûmysql·þ ......
character-set-server = GB2312
collation-server = latin1_general_ci
MySQL×Ö·û¼¯ GBK¡¢GB2312¡¢UTF8Çø±ð ½â¾ö MYSQLÖÐÎÄÂÒÂëÎÊÌâ ÊÕ²Ø
MySQLÖÐÉæ¼°µÄ¼¸¸ö×Ö·û¼¯
character-set-server/default-character-set£º·þÎñÆ÷×Ö·û¼¯£¬Ä¬ÈÏÇé¿öÏÂËù²ÉÓõġ£
character-set-database£ºÊý¾Ý¿â×Ö·û¼¯¡£
character-set-table£ºÊ ......