Mysql µ¼Èëµ¼³öµÄÎÊÌâ
¹ØÓÚMySqlµÄµ¼Èëµ¼³öÎÊÌâ
ÔÚÖÕ¶ËÖУ¬½øÈëmysqlµÄ·¾¶ÏµÄbinÖУ¬ÔÚÕâ¸ö·¾¶Ï¿ÉÒÔÖ´ÐÐmysql£¬mysqldumpµÈÃüÁî¡£
»òÕßÌí¼Ó»·¾³±äÁ¿ ÉèÖû·¾³±äÁ¿path "...(mysqlµÄ°²×°Â·¾¶ÏµÄbinĿ¼)"£¬ÕâÑù¾Í²»±ØÃ¿´Î¶¼½øÈëÉÏÃæËù˵µÄ·¾¶Ï²Ù×÷¡£
µ¼³öÒ»¸ö¿â£º
mysqldump -u µÇ¼Ãû -p ¿âÃû > Òª½«´Ë¿âµ¼³öµ½µÄÎļþ
eg: mysqldump -u root -p database1 > data1.sql
µ¼³öÒ»¸ö±í£º
mysqldump -u µÇ¼Ãû -p ¿âÃû ±íÃû > Òª½«´Ë¿âµ¼³öµ½µÄÎļþ
eg: mysqldump -u root -p database1 table1 > data2.sql
ÁíÍ⣬mysqldumpÖеÄÒ»¸ö²ÎÊý -h ºóÃæ¸úÒ»¸öipµØÖ·£¬±íʾÊDzÙ×÷´Ëip»úÆ÷ÉϵÄmysqlÊý¾Ý¿â
eg: mysqldump -h localhost -u root -p database1 table2 > data3.sql
µ¼Èëµ½Êý¾Ý¿âÖУº
mysql -h ip -u µÇ¼Ãû -p ¿âÃû < Òª½«´Ë¿âµ¼³öµ½µÄÎļþ
eg: mysql -h localhost -u root -database1 < data2.sql
»òÕß
½øÈëmysqlÏÂ("mysql>")ʹÓÃsourceÃüÁîµ¼Èë
eg: mysql> source D:\db\data3.sql
Ïà¹ØÎĵµ£º
SOURCE: CLICK HERE
±¾ÎĽ²ÊöSQL Server¡¢Oracle¡¢MySQL²é³öֵΪNULLµÄÌæ»»¡£
ÔÚSQL Server Oracle MySQLµ±Êý¾Ý¿âÖвé³öijֵΪNULLÔõô°ì?
1¡¢MSSQL: ISNULL()
Óï·¨
ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
re ......
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ÌìÄڼǼ
......
дÈëʱ£¬ÏÈ×öencode£º
public static String encode(String src) {
String result = null;
try {
result = new String(src.getBytes("gbk"), "ISO-8859-1");
} catch (UnsupportedEncodingException uee) {
System.err.println(uee);
}
return result;
}
¶Á³öʱ£¬ÔÙ×ödecode£º
public static String deco ......
×òÌìÓиö¹¦ÄÜҪʵÏÖÅÅÐÐЧ¹û£¬¶øÇÒÊÇËæ»ú°´ÕÕijЩ×ֶεÄ×ÜÖµ£¬µ«ÊǵÚÒ»¸öÓÖÒª²»Ò»Ñù£¬ÒòΪµÚÒ»¸öÈ˸øÁËÇ®£¬ËùÒÔÒªÅŵÚÒ»¡£
´ò¸ö±È·½°É£¬±í(userinfo)ÖÐÓÐÕ⼸¸ö×ֶΣºusername,isvalid,givedmoney,sumip,dayip,monthip,visitcount,regdate
ÏÖÔÚҪʵÏÖÏÔʾÅÅÐÐǰ10λÓû§£¬
³öÏÖÔÚÅÅÐеÚһλµ ......