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
Ïà¹ØÎĵµ£º
MySQL 4.1.12°²×°Æª
[Ïà¹ØÈí¼þÏÂÔØ£º]
Mysql 4.1.12-win32 -
For Windows ( Mysql 4.1.12-win32.exe ) -- Êý¾Ý¿â·þÎñ
ÏÂÔصØÖ·£º
http://cdgwbn.downloadsky.com:8080/down/mysql-4.1.12-win32.zip
Connector/ODBC
- MySQL ODBC driver ( MyODBC-3.51.11-1-win.exe ) -- Êý¾ÝÔ´
ÏÂÔصØÖ·£º
http://down.21sun.ne ......
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
2¡¢Àý2£ºÁ ......
ÔÚ[mysqld] ÏÂÌí¼Ó²ÎÊýÈçÏÂ
#´íÎóÈÕÖ¾Êä³ö·¾¶(ʹÓÃ/×÷Ϊ·Ö¸î¶ø²»ÊÇ\)
log-error="your error-log path"
log="Your mysql log path"
log-show-queries="Your slowquery path"
#É趨³¬Ê±Ê±¼ä ´Ë´¦ÉèÖÃΪÁ½Ãë
long_query_time=2
Ok save my.ini
next
#Í£Ö¹mysql ·þÎñ
net s ......
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=ÃÜÂë"); ......
·ÅÔÚÕâÀﱸÍü,ÀÏÊÇÍü¼ÇÔõôд¡£
mysql> create database book;
mysql> use book;
Database changed
mysql> create table email_message(key_mail_messages INTEGER,
-> date_created VARCHAR(19),
-> date_updated varchar(19),
-> date_email varchar(19),
-> addr_from va ......