¹ØÓÚTXTÎļþµ¼ÈëMYSQLÎÊÌâ
Ö÷ÒªÇé¿öÈçÏ£º
ÏÖÓÐÒ»Îı¾Êý¾ÝÎļþ£¬ÀïÃæµÄÊý¾ÝÈçÏ£º
abc 123
def 223 2 wwww
uuu 456 5 xxx
¡¡
Êý¾ÝÓм¸wÌõ Ò»ÐÐ×î¶à4ÁÐ µ«ÊÇ3£¬4Á½ÐпÉÄÜûÓУ¬Îª¿Õ¸ñ
¹ØÓÚÕâ¸öÎļþ£¬ÎÒÔõôµ¼È룬Çë¸ßÊÖÖ¸µã£¬Ç뾡Á¿Ïêϸ˵Ã÷¡£
PS£ºload data infile ÎÒÑо¿¹ý ûÓдËÀàÓï·¨ ÁÐÉèÖÃȱʡҲûÓÃ
½²Îļþµ¼ÈëtxtÎı¾
²éÕÒÌæ»» ¿Õ¸ñΪ /N
load data local infile
SQL code:
mysql> load data local infile 'D:\\csdn.txt' into table t
-> fields terminated by ' '
-> lines terminated by '\r';
Query OK, 4 rows affected, 2 warnings (0.03 sec)
Records: 4 Deleted: 0 Skipped: 0 Warnings: 1
mysql> select * from t;
+---------+------+------+--------+
| name | num | type | net |
+---------+------+------+--------+
| abc | 123 | 0 | NULL |
|
dee | 223 | 2 | www |
|
uuu | 456 | 5 | xxx |
|
uudkdu | 456 | 5 | xxxxxx |
+---------+------+------+--------+
4 rows in set (0.00 sec)
Ö±½ÓÓÃload data infile¾Í¿ÉÒÔ´¦ÀíÁË¡£¹À¼ÆÄãÉÏÃæÖ÷Òª´¦ÀíºÃÄãµÄÁзָô·û¾ÍÓ¦¸Ã¿ÉÒÔÁË£º
SQL code:
load data local infile 'Îļþ·¾¶' into table ±íÃû fiel
Ïà¹ØÎÊ´ð£º
ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......
Winform+MySQL×öÏîÄ¿£¬ÔÚ×¢ÖØÐÔÄܵÄÇé¿öÏ£¬ÎÒ¸ÃÈçºÎÈ¥Íê³ÉÕâÀàÐ͵ÄÏîÄ¿ÄØ£¡
Çë¸÷λ¸øÒÔÌáʾ¡£
ÄãÕâ¸ö·¶Î§Ì«¹ãÁË£¬ÎÒ˵2µãÖØÒªµÄ°É
1.WINFORM³ÌÐòÊǵ¥¶ÀÔËÐеÄCS³ÌÐò£¬ºÍBS²»Í¬£¬BSµÄѹÁ¦Ê¼ÖÕ¶¼ÔÚSERVERÉϵ쬶ÔC ......
´ó¼ÒºÃ£¬ÎÒÔÚ´´½¨Ë÷Òýʱ£¬³öÏÖ´íÎóÌáʾ£¬´úÂëÈçÏ£º
create uique index stu_cou_index on student_info.results (student_id, course_id);
show index from student_info.results;
±£´æÎªindex.s ......
SQL code:
UPDATE `footballmatch`.`promote` SET `pr_ballhype` = http://ballhype.com/post/url/?url=http%3A//www.allfootballtv.com/%3Fp%3D369&league=8 WHERE `promote`.`fm_post_id` =369
ÒÔÉ ......
select id,dtime,zt,optype( Èç¹ûoptype=0½«±¾ÌõÊý¾Ý²åÈëµ½table1±íÖУ¬Èç¹ûoptype=1ÒÔdtimeºÍztΪÌõ¼þÖ´ÐÐÒ»Ìõ²éѯÓï¾ä ) from table
ʵÏÖÕâ¸öÒªÇóµÄÓï·¨Ôõôд
Ò»ÌõSQLÓï¾ä¹À¼Æ¸ã²»¶¨¡£µÈ¥Ϻ÷½·¨£¡
Èç¹ ......