mysql:´´½¨Ë÷Òý³ö´í
´ó¼ÒºÃ£¬ÎÒÔÚ´´½¨Ë÷Òýʱ£¬³öÏÖ´íÎóÌáʾ£¬´úÂëÈçÏ£º
create uique index stu_cou_index on student_info.results (student_id, course_id);
show index from student_info.results;
±£´æΪindex.sql£¬È»ºóÔËÐУ¬³öÏÖ´íÎó£º
mysql> c:\wamp\www\index.sql
show warnings disabled.
show warnings disabled.
error:
unknown command '\i'
->
²¢ÇÒûÓа취»Øµ½mysql>µÄÌáʾ·û״̬£¬Ö»ÄܹرÕmysqlÔËÐÐ̨£¬ÔÙ´ÓнøÈë¡£¡£¡£
лл¸÷λ´óϺ£¬°ïÎÒ¿´¿´¡£¡£
×¢ÒâÄãÃüÁîÐеÄÊéд£¬×îºÃתÒå\ºÅ£¬
mysql > c:\\wamp\\www\\index.sql
»òÕß
mysql > c:/wamp/www/index.sql
ÎÒÊÔ¹ýÁË£¬²»ÊÇÕâ¸ö´íÎ󡣡£¡£
create unique index stu_cou_index on student_info.results (student_id, course_id);
лл3Â¥µÄ¼°Ê±»Ø¸´£¬µ«ÊǸÄÁË»¹ÊDz»ÐУ¬»¹ÊdzöÏÖ´íÎóÌáʾ
mysql> c:\wamp\www\index.sql
show warnings disabled.
show warnings disabled.
error:
unknown command '\i'
->
²¢ÇÒûÓа취»Øµ½mysql>µÄÌáʾ·û״̬£¬Ö»ÄܹرÕmysqlÔËÐÐ̨£¬ÔÙ´ÓнøÈë¡£¡£¡£
5Â¥£¬ÄãµÄ·½·¨ÊÇÕýÈ·µÄ£¬ÈçºÎÌí¼ÓÄã×öºÃÓÑÄØ£¿
Ïà¹ØÎÊ´ð£º
Á¬½ÓÊý¾Ý¿âʱÔõô³öÏÖÕâÑùµÄ´íÎó£º[localhost] ERROR 1045: Access denied for user 'root'@'localhost' (using password: YES)
ÔΣ¬Óï¾äÌùÀ´¿´¿´
ÄãÃÜÂëÄØ
ÃÜÂë´íÁË°É¡£
¸Õѧmysql,ÕÕ×ÅÊ ......
ÎÒ½¨ÁËÁ½¸ö±í£¬Ò»¸ö±íÃ÷user£¬Ò»¸ö±íanswer
±íuserµÄ½á¹¹{id,username,password}
±íanswerµÄ½á¹¹{A_id,question,answer,U_id}
Çë½Ì´ó¼ÒÎÒÔõôÉèÖòÅÄÜÔÚ±íuser²åÈëÊý¾Ýʱ£¬±íanswer¶ÔÓ¦µÄU_id×Ô¶¯¸üжÔÓ¦± ......
ÎÒʹÓÃC#Á¬½ÓmysqlÊý¾Ý¿â¶ÁÈ¡ÆäÖеÄÊý¾Ý£¬
¶ÁÈ¡Êý¾Ý±íÖеÄVarcharÀàÐ͵ÄÊý¾Ý£¬Èç¹ûÊÇÓ¢ÎÄÄܹ»Õý³£¶ÁÈ¡³öÀ´£¬
¶øÈç¹ûÊÇÖÐÎÄ£¬¾Í»áÏÔʾΪ¡°£¿£¿¡±£¬
Èç¹û°ÑvarcharÀàÐÍ»»³ÉbinaryÀàÐÍ£¬Asp.net³ÌÐòÄܹ»Õý ......
ÏÖÔÚÓÐÒ»¸öÍøÕ¾£¬ÏëÔÚÁíÍâһ̨·þÎñÆ÷ÉÏ×öÒ»¸öÕâ¸öÍøÕ¾µÄ¾µÏñ¡£
ÔÚÖ÷ÍøÕ¾ÉϵÄÊý¾Ý¸üÐÂҪͬ²½µ½¾µÏñ·þÎñÆ÷ÉÏ
ͬʱÓû§·ÃÎʾµÏñ·þÎñÆ÷ʱµÄÊý¾Ý¸üÐÂҲҪͬ²½µ½Ö÷ÍøÕ¾ÉÏ
ÆäÖÐÊý¾Ý¸üРÖ÷Òª°üÀ¨ MysqlÊý¾Ý ......
Java code:
Ä£ºý²éѯÊé°´ÕÕÊéÃû-------------------
java.sql.SQLException: Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'like'
at com.mys ......