FreeBSDÀûÓÃports°²×°MySQL+Apache+PHP
ʹÓÃPorts·½Ê½ÔÚFreeBSDÏÂÅäÖÃMySQL,Apache,PHP
ÓôÃÆÁ˺ü¸Ìì,ÖÕÓÚÔÚFreeBSDϽ«MySQL,Apache,PHPµÄ»·¾³ÅàÖ²ºÃÁË.ϱ߰ÑÅäÖò½ÖèºÍ×¢ÒâµãÂÞÁÐÔÚϱß,ºÍ´ó¼Ò·ÖÏí.
FreeBSD°æ±¾ÊÇ7.3,MySQL°æ±¾ÊÇ5.0.90,Apache°æ±¾ÊÇ2.2.14£¨1.3.42£©,PHP°æ±¾ÊÇ5.2.12.Îҵݲװ˳ÐòÊÇÏÈMySQL,È»ºó°²×°ApacheºÍPHP,Ò»°ãÊÇ°²×°Íê³ÉÒ»¸ö²¢²âÊÔͨ¹ýºó°²×°ÏÂÒ»¸ö,ÕâÑùÈÝÒ×·¢ÏÖÎÊÌâËùÔÚ.
Ò».°²×°MySQL
cd /usr/ports/databases/mysql50-server/
make WITH_XCHARSET=all //ĬÈÏÖ§³ÖËùÓÐ×Ö·û¼¯
make install
#¾ÀúÒ»¸ö±È½Ï³¤µÄÏÂÔغͱàÒë¹ý³Ìºó,mysql»ù±¾°²×°Íê³É.
rehash
#¿½±´MySQLµÄÅäÖÃÎļþ,ϵͳĬÈÏÌṩÁËËĸö,ÐèÒª¸ù¾Ý·þÎñÆ÷µÄÅäÖÃÀ´Ñ¡ÔñÊʺϵÄÅäÖÃÎļþ,MySQLµÄ´ó²¿·ÖÅäÖà #¶¼¿ÉÒÔͨ¹ý´ËÅäÖÃÎļþÀ´Íê³É,Ò²¿ÉÒÔÔÚ´ËÅäÖÃÎļþÖв鿴Êý¾Ý¿âµÄ¸÷ÖÖÅäÖÃÐÅÏ¢.
cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
#±à¼rc.confÎļþ,ÔÚÆäÖÐÌí¼Ómysql_enable="YES"
vi /etc/rc.conf
#Æô¶¯MySQL
cd /usr/local/etc/rc.d/
./mysql-server.sh start
#Æô¶¯MySQL¿Í»§¶Ë
cd /usr/local/bin
./mysql –u root -p
Èç¹ûÄܳɹ¦Á¬½Óµ½MySQL,Ôò±íʾ°²×°³É¹¦!
¶þ£®Apache+phpµÄ°²×°
Ò²ÐíÄúµÄmysqlÒѾ³É¹¦µÄÔËÐÐÁËÆðÀ´£¬µ«Õ⻹ÊÇÔ¶Ô¶ÎÞ·¨Âú×ãÒªÇóµÄ£¬ÍòάÍøµÄ´æ°ÜËƺõ¸úÖØÒªµÄÀ´×ÔÓÚApacheºÍPHPµÄ³É¹¦Óë·ñ——ÖÁÉÙ£¬Õâ¾ö¶¨ÄúÖ÷»ú¿ÉÒÔÔËÐÐÁ½²ã½á¹¹µÄÍøÕ¾¡£Ö¸¼âÔÚ±»È˳Æ×÷“СºÚ”µÄµçÄÔ¼üÅÌÉÏ·÷¶¯£¬ÎÒ¼üÈëÁË£º
cd /usr/ports/www/apache22/
make install clean
ÕýÈçÉÏÃæÒ»Ñù£¬ÎÒÓÖÒ»´Î»ØÒäÁËÎÒÐé¶ÈµÄͯÄêʱ¹â¡£
cd /usr/ports/lang/php5
make config £¬ÔÚÕâÀïҪѡÔñÄúÐèÒªµÄPHPµÄmodules£¬µ«Çë¼Çסһµã£¬Èç¹ûÄú²»Ñ¡ÔñapacheÖ§³ÖµÄ»°£¬Ò²ÐíÄú¾Í»áÒò´Ë¶øºó»ÚĪ¼°¡£É˺¦Ò»¸öϵͳµÄ×îºÃ·½·¨¾ÍÊÇÉ˺¦Ëû×î²»ÈÝÒײì¾õµÄµØ·½¡£
make install clean
rehash
ͯÄêÓÖÔÙÒ»´ÎµÄ±»»ØÒäÁËÆðÀ´£¬ÎÒËƺõ¿´¼ûÁ˼ÒÏçµÄÌÒ»¨……
µ±ÎÒ´Ó»ØÒäµÄèäèôÖнâÍѳöÀ´£¬»ØÉí£¬±àÒëÒѾ½áÊø£¬Ê£ÏµÄÖ»ÓÐÅäÖÃÁË£¬»ØζÖУ¬ÎÒÏ룬ÕâÒ²Ðí¾ÍÊÇÉú»î£¬µÈ´ýÖеÄÉú»î¡£
ÅäÖùý³ÌÏà±ÈÖ®ÏÂÊǽôÕŶøÍ´¿àµÄ£¬Ã»ÓÐÁËÂþ³¤µÄµÈ´ý£¬¸ü¶àµÄÊÇÑ°ÃÙ¡£
ÔÚ/usr/local/etc/apac
Ïà¹ØÎĵµ£º
½ñÌìÅöµ½ÕâÑùµÄÒ»¸öÎÊÌ⣺
ÎÒµçÄÔÉÏ°²×°ÁËwampserver£¬È»ºó´ò¿ªphpMyAdmin½øÐÐÊý¾Ý¿â¹ÜÀí²Ù×÷ʱ£¨´´½¨Êý¾Ý¿â£©£¬´´½¨ÍêÖ®ºó£¬µ½wampserver°²×°Ä¿Â¼µÄmysqlĿ¼Ï²鿴¸Õ´´½¨µÄÊý¾Ý¿â¡£¡£¡£ÔõôÕÒҲûÕÒµ½£¬ÎÒ¾ÍÓôÃÆ£¬È»ºó¾ÍÈ¥²éÕÒÎÊÌâµÄÔÒò£¬½á¹ûÊÇÕ⣺ÒòΪÎÒµçÄÔÉÏ°²×°WampServer֮ǰÓа²×°¹ýMysql£¬ËùÒÔÖ®ºó¶Ô ......
1.Ö±½ÓÔÚÊý¾Ý¿âÖÐÐ޸ļǼ
mysql> use mysql
mysql> update user set password = password(”new_password”) where user = “user_name”;
mysql> flush privileges;
ÆäʵÕâÖÖ·½·¨¾ÍÊǸüÐÂÒ»ÌõÊý¾Ý¿â¼Ç¼£¬ÓëÆÕͨupdateÓï¾ä²»Í¬µÄÊÇ£¬ÃÜÂë¼ÓÃÜ´æ´¢£¬ÐèÓÃpassword()º¯ÊýÀ´Éú³É£¬ÁíÒ»¸ö²»Í ......
Scale Out£ººáÏòÀ©Õ¹£¬Ôö¼Ó´¦Àí½ÚµãÌá¸ßÕûÌå´¦ÀíÄÜÁ¦
Scale Up£º×ÝÏòÀ©Õ¹£¬Í¨¹ýÌáÉýµ¥¸ö½ÚµãµÄ´¦ÀíÄÜÁ¦´ïµ½ÌáÉýÕûÌå´¦ÀíÄÜÁ¦µÄÄ¿µÄ
Replication
MySQLµÄreplicationÊÇÒì²½µÄ£¬ÊÊÓÃÓÚ¶ÔÊý¾ÝʵʱÐÔÒªÇó²»ÊÇÌرð¹Ø¼üµÄ³¡¾°¡£slave¶ËµÄIOÏ̸߳ºÔð´Ómaster¶ÁÈ¡ÈÕÖ¾£¬SQLÏß ³ÌרߺÔðÔÚslave¶ËÓ¦ÓôÓmaster¶Á¹ýÀ´µÄÈÕÖ¾£¨ÔçÆÚ ......
¶ÔÓÚÈκÎÒ»¸öÊý¾Ý¿â¹ÜÀíϵͳÀ´Ëµ£¬ÄÚ´æµÄ·ÖÅäʹÓþø¶Ô¿ÉÒÔËãµÄÉÏÊÇÆäºËÐÄÖ®Ò»ÁË£¬ËùÒԺܶàÏ£Íû¸üΪÉîÈëÁ˽âijÊý¾Ý¿â¹ÜÀíϵͳµÄÈË£¬¶¼»áÏ£ÍûÒ»¿ú¾¿¾¹£¬ÎÒÒ²²»ÀýÍâ¡£
´ÓÄÚ´æµÄʹÓ÷½Ê½MySQL Êý¾Ý¿âµÄÄÚ´æʹÓÃÖ÷Òª·ÖΪÒÔÏÂÁ½Àà
Ï̶߳ÀÏíÄÚ´æ&nb ......
1.¼ÓÔØmysqlÇý¶¯°üProperties->java Build Path->Libraries->Add External JARs...
2.Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/Êý¾Ý¿âÃû?user=root&password=ÃÜÂë"); ......