MySQLµÄmy.cnfÓÅ»¯ÊµÀý
http://linux.chinaitlab.com/MYSQL/524755_2.html
http://bbs.chinaunix.net/archiver/?tid-809159.html
ÔÚ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
Ïà¹ØÎĵµ£º
Weblogic 9.1µÄdomainÅäÖÃmysqlÁ¬½Ó³Ø
¡¡¡¡±¾ÎĽéÉÜÔÚweblogic 9.1ϵÄdomainÅäÖÃmysqlÁ¬½Ó³Ø²½Ö裺
¡¡¡¡1.ÔÚweblogicĿ¼ÏµÄserverlibÏÂÌí¼ÓmysqlÇý¶¯
¡¡¡¡mysql-connector-java-3.1.11-bin.jar
¡¡¡¡2.ÔÚweblogicĿ¼ÏµÄcommoninÏÂÕÒµ½commEnv.cmd´ò¿ª
¡¡¡¡ÕÒµ½set weblogic_classpath= ºó±ß¼ÓÉÏmysqlÇý¶¯ ......
°²×°Ñ¡ÔñGBK£¬Ê¹ÓÃÑ¡ÔñUTF-8¡£
½â¾ö·½·¨Ò»:(×îÖØÒªµÄÒ»ÖÖ·½·¨)
´ò¿ªmysqlĿ¼ÏµÄbinÎļþ¼Ð£¬ÕÒµ½my.ini£¬Ê¹ÓüÇʱ¾ÕÒ¿ª£¬·Ö±ðÕÒ“[mysql]¡¢[client]¡¢[mysqld]”£¬Ìí¼Ó£¨»ò¸Ä³É£©“default-character ......
µÚÒ»¡¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þ¡¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö²ÎÊý-h»úÆ÷IP
µÚÈý¡ ......
ÓÉÓÚÏîÄ¿ÐèÒª,¶Ômysql·Ö²¼ÊÂÎñÓÐÒ»¶¨ÒªÇó.ÕâÀïÏȼòµ¥ËµÃ÷±ØÒª.
¼ÙÉè,ÈÕ³£²ÆÎñÖÐ,ÒªÍê³ÉÒ»¸öÓµ»¤¶©¹º,±ØÐ뽫¶¨µ¥²Ù×÷ºÍ²ÆÎñ²Ù×÷·âÔÚÒ»¸öÊÂÎñÖвÅÄܱ£Ö¤½»Ò×ÍêÕûÐÔ.
Èç¹û¶¨µ¥ºÍ²ÆÎñÊý¾Ý¶¼·Ö²¼ÔÚ¸÷×ÔµÄʵÀýÖÐ,Ôò±ØÐëÓ÷ֲ¼ÊÂÎñ²ÅÄÜÂú×ã.
·Ï»°²»¶à£¬½øÈë·Ö²¼ÊÂÎñ̽Ë÷¡£
(±¾ÎÄÀý×ÓÀ´×ÔÍøÂ磬±¾ÎÄÖ»×¢ÖØ̽Ë÷£©
1.ÔÚ±¾»ú loca ......
°²×°mysql
sudo apt-get install mysql-server#Ö±½Ó×Ô¶¯»ñµÃ¿ÉÓð汾
Ò²¿ÉÒÔÕâÑùд
sudo apt-geti nstall mysql-server-5.0#°²×°mysql·þÎñÆ÷5.0°æ±¾
°²×°ºó
/etc/init.d/mysqlstart(stop)ΪÆô¶¯ºÍÍ£Ö¹·þÎñÆ÷
/etc/mysql/Ö÷ÒªÅäÖÃÎļþËùÔÚλÖÃmy.cnf
/var/lib/mysql/·ÅÖõÄÊÇÊý¾Ý¿â±íÎļþ¼Ð£¬ÕâÀïµÄmysqlÏ൱ÓÚ ......