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

mysqlº¯Êý»ã×Ü


Ò»¡¢
¿ØÖÆÁ÷³Ìº¯Êý
a)        
CASE WHEN THEN
º¯Êý
Óï·¨£º
CASE value WHEN [compare-value]
THEN result [WHEN [compare-value] THEN result ……] [ELSE result ] END CASE WHEN
[condition] THEN result [WHEN[condition] THEN result ……] [ELSE result] END
£»
º¯ÊýÓ÷¨ËµÃ÷£ºÔÚµÚÒ»¸ö·½°¸µÄ·µ»Ø½á¹ûÖУ¬
value
=compare-value
¡£¶øµÚ¶þ¸ö·½°¸µÄ·µ»Ø½á¹ûÊǵÚÒ»ÖÖÇé¿öµÄÕæʵ½á¹û¡£Èç¹ûûÓÐÆ¥ÅäµÄ½á¹ûÖµ£¬Ôò·µ»Ø½á¹ûΪ
ELSE
ºóµÄ½á¹û£¬Èç¹ûûÓÐ
ELSE
²¿·Ö£¬Ôò·µ»ØֵΪ
NULL
b)       
IF
º¯ÊýÓ÷¨
Óï·¨£º
IF(expr1,expr2,expr3)
º¯ÊýÓ÷¨ËµÃ÷£ºÈç¹û
expr1

ÊÇ
TRUE (expr1
<> 0 and expr1
<> NULL)
£¬Ôò
IF()
µÄ·µ»ØֵΪ
expr2
;
·ñÔò·µ»ØÖµÔòΪ
expr3
¡£
IF()
µÄ·µ»ØֵΪÊý×ÖÖµ»ò×Ö·û´®Öµ£¬¾ßÌåÇé¿öÊÓÆäËùÔÚÓï¾³¶ø¶¨
c)       
IFNULL
º¯Êý
Óï·¨£º
IFNULL(expr1,expr2)
º¯ÊýÓ÷¨ËµÃ÷£º¼ÙÈç
expr1

²»Îª
NULL
£¬Ôò
IFNULL()
µÄ·µ»ØֵΪ
expr1
;
·ñÔòÆä·µ»ØֵΪ
expr2
¡£
IFNULL()
µÄ·µ»ØÖµÊÇÊý×Ö»òÊÇ×Ö·û´®£¬¾ßÌåÇé¿öÈ¡¾öÓÚÆäËùʹÓõÄÓï¾³
¶þ¡¢
×Ö·û´®±È½Ïº¯Êý
a)        
º¯Êý
ascii(str)
º¯ÊýÓ÷¨ËµÃ÷£º·µ»ØֵΪ×Ö·û´®
str

µÄ×î×ó×Ö·ûµÄÊýÖµ¡£¼ÙÈç
str
Ϊ¿Õ×Ö·û´®£¬Ôò·µ»ØֵΪ
0
¡£¼ÙÈç
str

Ϊ
NULL
£¬Ôò·µ»ØֵΪ
NULL
¡£
ASCII()
ÓÃÓÚ´øÓдÓ
0
µ½
255
µÄÊýÖµµÄ×Ö·û
b)       
º¯Êý
BIN(N)
º¯ÊýÓ÷¨ËµÃ÷£º·µ»ØֵΪ
N
µÄ¶þ½øÖÆÖµµÄ×Ö·û´®±íʾ£¬ÆäÖÐ
  N

Ϊһ¸ö
longlong (BIGINT)
Êý×Ö¡£ÕâµÈͬÓÚ
CONV(N
,10,2)
¡£¼ÙÈç
N

Ϊ
NULL
£¬Ôò·µ»ØֵΪ
NULL
¡£
c)       
º¯ÊýCHAR(N
,...
[USING charset
])
º¯ÊýÓ÷¨ËµÃ÷£º
CHAR()
½«Ã¿¸ö²ÎÊý
N
Àí½âΪһ¸öÕûÊý£¬Æä·µ»ØֵΪһ¸ö°üº¬ÕâЩÕûÊýµÄ´úÂëÖµËù¸ø³öµÄ×Ö·ûµÄ×Ö·û´®¡£
NULL
Öµ±»Ê¡ÂÔ¡£
d)       
º¯ÊýCHAR_LENGTH(str
)
º¯ÊýʹÓÃ˵Ã÷£º·µ»ØֵΪ×Ö·û´®
str

µÄ³¤¶È£¬³¤¶ÈµÄµ¥Î»Îª×Ö·û¡£Ò»¸ö¶à×Ö½Ú×Ö·ûËã×÷


Ïà¹ØÎĵµ£º

mysql³£ÓÃÃüÁî

 
1¡¢mysqlÊý¾Ý¿âÓÐÁ½ÖÖÇý¶¯£º
MySQL Connector/J Driver¡¢MMMysql driver¡£
2¡¢µ¼Èëµ¼³öÊý¾Ý¿âÃüÁ£¨binĿ¼Ï£©
µ¼³ö£ºmysqldump -u root -p bokele   >c:/mysql.sql   --default-character-set=gbk  
µ¼È룺C:\mysql\bin\> mysql -u root -p
˵Ã÷£ºC:\mysql\bin\±íʾ½øÈëmysql³ÌÐò ......

.\mysql\user is marked as crashed ½â¾ö°ì·¨

 
I found a solution to anyone else who may be having this problem.
First start mysql using skip grant tables
root@ns1 [/var/lib/mysql/mysql]# service mysql start --skip-grant-tables
Starting MySQL [ OK ]
now with mysql started, you can repair the mysql/user table
root@ns1 [/var/lib/mysql ......

mysqliÓëmysqlÇø±ð

 mysqlÊǷdzּÌÁ¬½Óº¯Êý¶ømysqliÊÇÓÀÔ¶Á¬½Óº¯Êý¡£Ò²¾ÍÊÇ˵
mysqlÿ´ÎÁ´½Ó¶¼»á´ò¿ªÒ»¸öÁ¬½ÓµÄ½ø³Ì¶ømysqli¶à´ÎÔËÐÐmysqli½«Ê¹ÓÃͬһÁ¬½Ó½ø³Ì,´Ó¶ø¼õÉÙÁË·þÎñÆ÷µÄ¿ªÏú
ÓÐЩÅóÓÑÔÚ±à³ÌµÄʱºò£¬Ê¹ÓÃnew mysqli('localhost', usenamer', 'password', 'databasename');×ÜÊDZ¨´í£¬Fatal error: Class 'mysqli' not found in ......

ÖØа²×°mysqlµÄÐĵÃ

Ôø¾­Ê§°Ü¹ýn´Î£¬ÈÃÎÒÏ൱ÎÞÄÎ×îºóÖÕÓÚÕÒµ½ÁËÒ»¸ö½â¾ö·½°¸£¬¹©´ó¼Ò·ÖÏí
ɾµô×¢²á±íµÄ·½·¨£¬ÎÒÒ²Ôø¾­Óùý£¬µ«×ÜÊÇʧ°Ü£¬½¨ÒéÈçÏÂ
Ò»£ºÏÈжÔØÈí¼þmysql
¶þ£ºÏÈɾע²á±íµÄ¶«Î÷£»
Èý£º×îºóÔÚÄãµÄµ±Ç°Óû§ÀïcÅÌÏÂC:\Documents and Settings\All Users\Application Data\ÕÒµ½mysqlµÄĿ¼£¬É¾µô£¬ÍüÁ˸æËßÒ»¾ä£»
ÄÇÊÇÒþ²ØÎļþ£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ