Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÏ php5 MySQL5 Apache2 °²×°ÓëÅäÖÃ


mkdir /downloads
chown -R root:root /downloads
chmod -R 774 /downloads
Ò»¡¢°²×°Apache2
    ÏÂÔصØÖ·£ºhttp://www.apache.org/ --> HTTP Server --> from a mirror
    1. »ñÈ¡mysqlÔ´Âë
        shell> cd /downloads
        shell> wget http://apache.etoak.com/httpd/httpd-2.2.11.tar.gz
    2. Ïë½âѹËõ°ü£¬½øÈë¸ÃĿ¼    
        shell> tar zxvf httpd-2.2.11.tar.gz
        shell> cd httpd-2.2.11/
    3. ±àÒë°²×°£¬×Ô¶¨Ò尲װĿ¼¡£    
        shell> ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite  ##×¢£ºapache 1.3.* Óëapache 2.*.* ²»Í¬ ¿ÉÒÔÓÃ./configure --help²é¿´
        shell> make && make install
    4. Æô¶¯Apache2¡£
        shell> /usr/local/apache/bin/apachectl start
¶þ¡¢°²×°MySQL5
    ÏÂÔصØÖ·£ºhttp://www.mysql.com/ --> downloads --> MySQL Community Server
    1. Ìí¼ÓmysqlÓû§ºÍÓû§×飺
        shell> groupadd mysql
        shell> useradd -g mysql mysql
    2. »ñÈ¡mysqlÔ´Âë
        shell> cd /downloads 
        shell> wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.36.tar.gz/from/http://mysql.stu.edu.tw/ 
    3. Ïë½âѹËõ°ü£¬½øÈë¸ÃĿ¼
        shell> tar zxvf mysql-5.1.36.tar.gz 
        shell> cd mysql-5.1.36/
    4. ±àÒë°²×°£¬×Ô¶¨Ò尲װĿ¼¡£
        shell> ./configure --prefix=/usr/local/mysql  ##–with-charset=utf8 –with-collation=utf8_general_ci –with-extra-charsets=utf8
     &nbs


Ïà¹ØÎĵµ£º

MySQL±àÂëÎÊÌâ

my.iniÎļþÅäÖ㺠[mysql] default-character-set=GBK #´Ë´¦µÄ±àÂëÊÇMySQL¿ØÖÆ̨ÏÔʾµÄ±àÂ뷽ʽ£¬Ó¦¸ÃÉèÖÃΪGBK [mysqld] default-character-set=utf8 #´Ë´¦µÄ±àÂëÊÇMySQLÊý¾Ý´æ´¢µÄ¸ñʽ£¬Ó¦¸ÃÉèÖÃΪutf8£¬¿ÉÒÔ´æ´¢ÊÀ½çÉϾø´ó¶àÊý×Ö·û ......

MySQL Ë÷ÒýdzÎö

Ô­ÎÄÁ´½Ó£ºhttp://hi.baidu.com/171892549/blog/item/14818d0ac616ee34b1351dbd.html
ÔÚÊý¾Ý¿â±íÖУ¬Ê¹ÓÃË÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËٶȡ£
¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö testIndex ±í£º
CREATE TABLE testIndex(i_testID INT NOT NULL,vc_Name VARCHAR(16) NOT NULL);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË 1000 Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ i_testID vc_Name ......

MYSQL Íâ¼ü¶¨Òå




½¨Á¢Íâ¼üµÄÇ°Ì᣺ ±¾±íµÄÁбØÐëÓëÍâ¼üÀàÐÍÏàͬ(Íâ¼ü±ØÐëÊÇÍâ±íÖ÷¼ü)¡£
Íâ¼ü×÷Ó㺠ʹÁ½ÕűíÐγɹØÁª£¬Íâ¼üÖ»ÄÜÒýÓÃÍâ±íÖеÄÁеÄÖµ£¡
Ö¸¶¨Ö÷¼ü¹Ø¼ü×Ö£º foreign key(ÁÐÃû)
ÒýÓÃÍâ¼ü¹Ø¼ü×Ö£º references <Íâ¼ü±íÃû>(Íâ¼üÁÐÃû)
ʼþ´¥·¢ÏÞÖÆ: on deleteºÍon update , ¿ÉÉè²ÎÊýcascade(¸úËæÍâ¼ü¸Ä¶¯ ......

mysqlÈÕÆÚºÍʱ¼ä¸ñʽת»»

¶ÔÓÚÿ¸öÀàÐÍÓµÓеÄÖµ·¶Î§ÒÔ¼°²¢ÇÒÖ¸¶¨ÈÕÆÚºÎʱ¼äÖµµÄÓÐЧ¸ñʽµÄÃèÊö¼û7.3.6 ÈÕÆÚºÍʱ¼äÀàÐÍ¡£
ÕâÀïÊÇÒ»¸öʹÓÃÈÕÆÚº¯ÊýµÄÀý×Ó¡£ÏÂÃæµÄ²éѯѡÔñÁËËùÓмǼ£¬Æädate_colµÄÖµÊÇÔÚ×îºó30ÌìÒÔÄÚ£º
mysql> SELECT something from table
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
DAYOFWEEK(date)
·µ»ØÈÕÆ ......

mysql»ù±¾ÃüÁî

 Æô¶¯£ºnet start mySql;
  ½øÈ룺mysql -u root -p/mysql -h localhost -u root -p databaseName;
  ÁгöÊý¾Ý¿â£ºshow databases;
  Ñ¡ÔñÊý¾Ý¿â£ºuse databaseName;
  Áгö±í¸ñ£ºshow tables£»
  ÏÔʾ±í¸ñÁеÄÊôÐÔ£ºshow columns from tableName£»
  ½¨Á¢Êý¾Ý¿â£ºsource fileNam ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ