mysql´æ´¢¹ý³Ìtips
ʾÀý£º
create procedure proc_name (in parameter integer)
begin
declare variable varchar(20);
if parameter=1 then
set variable='MySQL';
else
set variable='PHP';
end if;
insert into tb (name) values (variable);
end;
MySQLÀ©Õ¹Ò²ÊÇÖ§³Ö´æ´¢¹ý³ÌµÄ£¬²»¹ýÖ»Ö§³ÖÎÞ·µ»Ø½á¹ûµÄ´æ´¢¹ý³Ì
¿ÉÒÔʹÓÃmysqliÀ´´úÌæ
Ïà¹ØÎĵµ£º
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ÌìÄڼǼ
......
¸ømysql¿ªÒ»¸ö¿ÉÒÔÔ¶³Ì·ÃÎʵÄÓû§ÃüÁîÈçÏÂ:
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
"*.*" ±íʾÊý¾Ý¿âÖÐËùÓеıí,Ò²¿ÉÒÔ»»³ÉÖ¸¶¨µÄ±íÈçtest.*
"myuser" ±íʾµÄÊÇ·ÃÎʵÄÓû§Ãû;
"%" ±íʾËùÓеÄÖ÷»ú¼´ÈκεÄÖ÷»ú¶¼¿ÉÒÔͨ¹ýÕâ¸öÓû§Ãû·ÃÎÊÎÒµÄÊý¾Ý¿â,Ò²¿ÉÒԸóÉÌض¨µ ......
1£º Can’t connect to [local] MySQL server´íÎó
Ò»¸öMySQL¿Í»§¿ÉÒÔÁ½ÖÖ²»Í¬µÄ·½Ê½Á¬½Ómysqld·þÎñÆ÷£ºUnixÌ×½Ó×Ö£¬Ëüͨ¹ýÔÚÎļþϵͳÖеÄÒ»¸öÎļþ(ȱʡ“/tmp /mysqld.sock”)½øÐÐÁ¬½Ó£»»òTCP/IP£¬Ëüͨ¹ýÒ»¸ö¶Ë¿ÚºÅÁ¬½Ó¡£UnixÌ×½Ó×Ö±ÈTCP/IP¸ü¿ì£¬µ«ÊÇÖ»ÓÐÓÃÔÚÁ¬½Óͬһ̨¼ÆËã»úÉϵķþÎñÆ÷¡£Èç¹ûÄ ......
ÔÚʹÓÃWindowsÃüÁîÐвÙ×÷MySQLÊý¾Ý¿âµÄʱºò£¬ÒÔutf8¸ñʽ´æ´¢ÔÚMySQLÊý¾Ý¿âÖеÄÊý¾Ý£¬´ÓÃüÁîÐжÁÈ¡³öÀ´×ÜÊÇÂÒÂ룬ÏÔʾȫÊÇÎʺš£»òÕß´ÓÃüÁîÐвåÈëÐÂÊý¾Ý£¬½á¹ûÏà·´£¬ÔÚÃüÁîÐÐÖÐÏÔʾÊÇÕý³£µÄ£¬µ«ÊÇÔÚPHPMyAdminÖÐÈ´ÊÇÂÒÂë¡£
¡¡¡¡¾¹ýÉÏÍø²éÕÒÑо¿£¬·¢ÏÖmysqlµÄÃüÁîÐпͻ§¶Ë¸ù±¾ÎÞ·¨ÒÔutf-8µÄÐÎʽ·µ»ØÊý¾Ý£¬½â¾öÈçÏ¡£
¡¡¡¡² ......