ËùÐèÈí¼þÔ´´úÂë°ü£º
httpd-2.2.4.tar.gz mysql-5.0.27.tar.gz php-5.2.1.tar.bz2
freetype-2.3.2.tar.gz gd-2.0.34.tar.gz jpegsrc.v6b.tar.gz
libpng-1.2.8.tar.bz2 libxml2-2.6.24.tar.bz2 zlib-1.2.2.tar.gz
°²×°Ë³Ðò£ºapache -> mysql -> freetype -> jpegsrc.v6b -> libpng -> libxml -> zlib -> gd -> php ( freetype,jpegsrc.v6b,libxml,zlib,libpng µÄ°²×°Ë³Ðò²»ÏÞ)
Ô¼¶¨Ä¿Â¼£º/usr/local/src Èí¼þÔ´´úÂë°ü´æ·ÅλÖÃ
/usr/local/software_name Ô´Âë°ü±àÒ밲װλÖÃ
°²×°ÃüÁ
1 apache
# cd /usr/local/src
# t ar xzvf http-2.2.4.tar.gz
# cd http-2.2.4
# ./configure \
"--prefix=/usr/local/apache2" \
"--enable-module=so" \
"--enable-deflate=shared" \
&nbs ......
ËùÐèÈí¼þÔ´´úÂë°ü£º
httpd-2.2.4.tar.gz mysql-5.0.27.tar.gz php-5.2.1.tar.bz2
freetype-2.3.2.tar.gz gd-2.0.34.tar.gz jpegsrc.v6b.tar.gz
libpng-1.2.8.tar.bz2 libxml2-2.6.24.tar.bz2 zlib-1.2.2.tar.gz
°²×°Ë³Ðò£ºapache -> mysql -> freetype -> jpegsrc.v6b -> libpng -> libxml -> zlib -> gd -> php ( freetype,jpegsrc.v6b,libxml,zlib,libpng µÄ°²×°Ë³Ðò²»ÏÞ)
Ô¼¶¨Ä¿Â¼£º/usr/local/src Èí¼þÔ´´úÂë°ü´æ·ÅλÖÃ
/usr/local/software_name Ô´Âë°ü±àÒ밲װλÖÃ
°²×°ÃüÁ
1 apache
# cd /usr/local/src
# t ar xzvf http-2.2.4.tar.gz
# cd http-2.2.4
# ./configure \
"--prefix=/usr/local/apache2" \
"--enable-module=so" \
"--enable-deflate=shared" \
&nbs ......
ËùÐèÈí¼þÔ´´úÂë°ü£º
httpd-2.2.4.tar.gz mysql-5.0.27.tar.gz php-5.2.1.tar.bz2
freetype-2.3.2.tar.gz gd-2.0.34.tar.gz jpegsrc.v6b.tar.gz
libpng-1.2.8.tar.bz2 libxml2-2.6.24.tar.bz2 zlib-1.2.2.tar.gz
°²×°Ë³Ðò£ºapache -> mysql -> freetype -> jpegsrc.v6b -> libpng -> libxml -> zlib -> gd -> php ( freetype,jpegsrc.v6b,libxml,zlib,libpng µÄ°²×°Ë³Ðò²»ÏÞ)
Ô¼¶¨Ä¿Â¼£º/usr/local/src Èí¼þÔ´´úÂë°ü´æ·ÅλÖÃ
/usr/local/software_name Ô´Âë°ü±àÒ밲װλÖÃ
°²×°ÃüÁ
1 apache
# cd /usr/local/src
# t ar xzvf http-2.2.4.tar.gz
# cd http-2.2.4
# ./configure \
"--prefix=/usr/local/apache2" \
"--enable-module=so" \
"--enable-deflate=shared" \
&nbs ......
¡¡¡¡1.mysql
¡¡¡¡ÔÚÈçÏÂÒ³ÃæÏÂÔØmysqlµÄfor linux rpm°ü
¡¡¡¡¡¡http://www.mysql.com/downloads/down...3.52-1.i386.rpm ;
¡¡¡¡¡¡http://www.mysql.com/downloads/down...3.52-1.i386.rpm ;
¡¡¡¡´æÖÁ/home/tmpĿ¼
¡¡¡¡ÃüÁîÁÐ±í£º¡¡
¡¡¡¡cd /home/tmp
¡¡¡¡rpm -ivh MySQL-3.23.52-1.i386.rpm #°²×°mysql server
¡¡¡¡rpm -ivh MySQL-client-3.23.52-1.i386.rpm #°²×°mysql client
¡¡¡¡/usr/mysql/safe_mysqld & #Æô¶¯mysql server
¡¡¡¡mysql #ÔËÐÐmysql ¿Í»§¶Ë,²¢¿ª·ÅrootÓû§µÄÔ¶³Ì·ÃÎÊȨÏÞ¡£ÒÔ±ãµ÷ÊÔ
¡¡¡¡use mysql
¡¡¡¡update user set host = '%' where user = 'root' and host <> 'localhost';
¡¡¡¡flush privileges;
¡¡¡¡quit
¡¡¡¡ÖÁ´Ëmysql°²×°Íê³É
¡¡¡¡2.apache
¡¡¡¡ÔÚÈçÏÂÒ³ÃæÏÂÔØapacheµÄfor linux µÄÔ´Âë°ü¡¡¡¡
¡¡¡¡http://www.apache.org/dist/httpd/apache_1.3.26.tar.gz ;
¡¡¡¡´æÖÁ/home/tmpĿ¼
¡¡¡¡ÃüÁîÁÐ±í£º¡¡
¡¡¡¡cd /home/tmp
¡¡¡¡tar -zxvf apache_1.3.26.tar.gz
¡¡¡¡mv apache_1.3.26.tar.gz apache
¡¡¡¡cd apache
¡¡¡¡./configure --prefix=/usr/local/apache --enable-module=so
¡¡¡¡m ......
¡¡¡¡1.mysql
¡¡¡¡ÔÚÈçÏÂÒ³ÃæÏÂÔØmysqlµÄfor linux rpm°ü
¡¡¡¡¡¡http://www.mysql.com/downloads/down...3.52-1.i386.rpm ;
¡¡¡¡¡¡http://www.mysql.com/downloads/down...3.52-1.i386.rpm ;
¡¡¡¡´æÖÁ/home/tmpĿ¼
¡¡¡¡ÃüÁîÁÐ±í£º¡¡
¡¡¡¡cd /home/tmp
¡¡¡¡rpm -ivh MySQL-3.23.52-1.i386.rpm #°²×°mysql server
¡¡¡¡rpm -ivh MySQL-client-3.23.52-1.i386.rpm #°²×°mysql client
¡¡¡¡/usr/mysql/safe_mysqld & #Æô¶¯mysql server
¡¡¡¡mysql #ÔËÐÐmysql ¿Í»§¶Ë,²¢¿ª·ÅrootÓû§µÄÔ¶³Ì·ÃÎÊȨÏÞ¡£ÒÔ±ãµ÷ÊÔ
¡¡¡¡use mysql
¡¡¡¡update user set host = '%' where user = 'root' and host <> 'localhost';
¡¡¡¡flush privileges;
¡¡¡¡quit
¡¡¡¡ÖÁ´Ëmysql°²×°Íê³É
¡¡¡¡2.apache
¡¡¡¡ÔÚÈçÏÂÒ³ÃæÏÂÔØapacheµÄfor linux µÄÔ´Âë°ü¡¡¡¡
¡¡¡¡http://www.apache.org/dist/httpd/apache_1.3.26.tar.gz ;
¡¡¡¡´æÖÁ/home/tmpĿ¼
¡¡¡¡ÃüÁîÁÐ±í£º¡¡
¡¡¡¡cd /home/tmp
¡¡¡¡tar -zxvf apache_1.3.26.tar.gz
¡¡¡¡mv apache_1.3.26.tar.gz apache
¡¡¡¡cd apache
¡¡¡¡./configure --prefix=/usr/local/apache --enable-module=so
¡¡¡¡m ......
24СʱÄڼǼ£¨¼´86400Ã룩
$sql="SELECT video_id,count(id)as n from `rec_down` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(add_time)<=86400 group by video_id order by n desc ";
$sql="select a.id,a.title,b.n from video_info a,(".$sql.")b where a.id=b.video_id order by n desc limit 20";
NÌìÄڼǼ
WHERE TO_DAYS(NOW()) - TO_DAYS(ʱ¼ä×Ö¶Î) <= N
½ñÌìµÄ¼Ç¼
where date(ʱ¼ä×Ö¶Î)=date(now())
»ò
where to_days(ʱ¼ä×Ö¶Î) = to_days(now());
²éѯһÖÜ£º
select * from table where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time);
²éѯһ¸öÔ£º
select * from table where DATE_SUB(CURDATE(), INTERVAL INTERVAL 1 MONTH) <= date(column_time);
²éѯѡÔñËùÓÐ date_col ÖµÔÚ×îºó 30 ÌìÄڵļǼ¡£
mysql> SELECT something from tbl_name
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30; //Õæ·½±ã,ÒÔÇ°¶¼ÊÇ×Ô¼ºÐ´µÄ,¾¹È»²»ÖªµÀÓÐÕâ,ʧ°Ü.
DAYOFWEEK(date)
·µ»Ø date µÄÐ ......
MySQL Á·Ï°ÊÖ¸å
MySQL ½éÉÜ
MySQL ABÊÇÓÉMySQL´´Ê¼È˺ÍÖ÷Òª¿ª·¢ÈË´´°ìµÄ¹«Ë¾¡£MySQL AB×î³õÊÇÓÉDavid Axmark¡¢Allan
LarssonºÍMichael“Monty
”WideniusÔÚÈðµä´´°ìµÄ¡£
¹«Ë¾ÃûÖеēAB”ÊÇÈðµäÓï“aktiebolag
”»ò“¹É·Ý¹«Ë¾”µÄÊ××ÖĸËõд¡£¿É½«Æä·ÒëΪ“MySQLÓÐÏÞ¹«Ë¾”¡£ÊÂʵÉÏ£¬MySQLÓÐÏÞ¹«Ë¾ºÍMySQLGmbH¾ùÊÇMySQL
AB×Ó¹«Ë¾µÄÃû³Æ¡£ËüÃÇ·Ö±ðλÓÚÃÀ¹úºÍµÂ¹ú¡£
MySQLÊÇ×îÁ÷ÐеĿª·ÅÔ´ÂëSQLÊý¾Ý¿â¹ÜÀíϵͳ£¬ËüÊÇÓÉMySQL AB¹«Ë¾¿ª·¢¡¢·¢²¼²¢Ö§³ÖµÄ¡£MySQL
ABÊÇÓɶàÃûMySQL¿ª·¢ÈË´´°ìµÄÒ»¼ÒÉÌÒµ¹«Ë¾¡£ËüÊÇÒ»¼ÒµÚ¶þ´ú¿ª·ÅÔ´Â빫˾£¬½áºÏÁË¿ª·ÅÔ´Âë¼ÛֵȡÏò¡¢·½·¨ºÍ³É¹¦µÄÉÌҵģÐÍ¡£
MySQLµÄÖ÷ÒªÌØÐÔ
1¡¢Ê¹ÓÃCºÍC++±àд
2¡¢Äܹ»¹¤×÷ÔÚÖڶ಻ͬµÄƽ̨ÉÏ
3¡¢Ê¹ÓÃGNU Automake¡¢AutoconfºÍLibtool½øÐÐÒÆÖ²
4¡¢ÌṩÁËÓÃÓÚC¡¢C++¡¢Eiffe ......
Ò»Ö±ÒÔΪmysqlËæ»ú²éѯ¼¸ÌõÊý¾Ý£¬¾ÍÓÃ
SELECT
*
from
`
table
`
ORDER
BY
RAND
() LIMIT
5
¾Í¿ÉÒÔÁË¡£
µ«ÊÇÕæÕý²âÊÔһϲŷ¢ÏÖÕâÑùЧÂʷdz£µÍ¡£Ò»¸ö15ÍòÓàÌõµÄ¿â£¬²éѯ5ÌõÊý¾Ý£¬¾ÓȻҪ8ÃëÒÔÉÏ
²é¿´¹Ù·½ÊֲᣬҲ˵rand()·ÅÔÚORDER BY ×Ó¾äÖлᱻִÐжà´Î£¬×ÔȻЧÂʼ°ºÜµÍ¡£
You cannot use a column with RAND() values in an ORDER BY clause,
because ORDER BY would evaluate the column multiple times.
ËÑË÷Google£¬ÍøÉÏ»ù±¾É϶¼ÊDzéѯmax(id) * rand()À´Ëæ»ú»ñÈ¡Êý¾Ý¡£
SELECT
*
from
`
table
`
AS
t1
JOIN
(
SELECT
ROUND
(
RAND
()
*
(
SELECT
MAX
(id)
from
`
table
`))
AS
id)
AS
t2
WHERE
t1.id
>=
t2.id
ORDER
BY
t1.id
ASC
LIMIT
5
;
µ«ÊÇÕâÑù»á²úÉúÁ¬ÐøµÄ5Ìõ¼Ç¼¡£½â¾ö°ì·¨Ö»ÄÜÊÇÿ´Î²éѯһÌõ£¬²éѯ5´Î¡£¼´±ãÈç´ËÒ²ÖµµÃ£¬ÒòΪ15ÍòÌõµÄ±í£¬²éѯֻÐèÒª0.0 ......
/*ÑÝʾһ¸öJDBC³ÌÐò£¬´ÓMysqlµÄLMDÊý¾Ý¿âÖжÁ³ö±íadminµÄÒ»¸öÐÅÏ¢*/
import java.sql.*;
public class TestMysqlConnection {
public static void main(String[] args) {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager
.getConnection("jdbc:mysql://localhost/LMD?user=root&password=root");
stmt = conn.createStatement();
rs = stmt.executeQuery("select * from admin");
  ......