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

MySQLѧϰ

C APIÏà¹Ø
C APIÊý¾ÝÀàÐÍ
 MYSQL
¸Ã½á¹¹´ú±í1¸öÊý¾Ý¿âÁ¬½ÓµÄ¾ä±ú¡£¼¸ºõËùÓеÄMySQLº¯Êý¾ùʹÓÃËü¡£²»Ó¦³¢ÊÔ¿½±´MYSQL½á¹¹¡£²»±£Ö¤ÕâÀ࿽±´½á¹û»áÓÐÓá£
 MYSQL_RES
¸Ã½á¹¹´ú±í·µ»ØÐеIJéѯ½á¹û£¨SELECT, SHOW, DESCRIBE, EXPLAIN£©¡£ÔÚ±¾½ÚµÄÊ£Óಿ·Ö£¬½«²éѯ·µ»ØµÄÐÅÏ¢³ÆΪ“½á¹û¼¯”¡£
 MYSQL_ROW
ÕâÊÇ1ÐÐÊý¾ÝµÄ“ÀàÐÍ°²È«”±íʾ¡£ËüÄ¿Ç°ÊÇ°´ÕÕ¼ÆÊý×Ö½Ú×Ö·û´®µÄÊý×éʵʩµÄ¡££¨Èç¹û×Ö¶ÎÖµ¿ÉÄÜ°üº¬¶þ½øÖÆÊý¾Ý£¬²»Äܽ«Æäµ±×÷ÓÉNullÖÕ½áµÄ×Ö·û´®¶Ô´ý£¬ÕâÊÇÒòΪÕâÀàÖµ¿ÉÄÜ»á°üº¬Null×Ö½Ú£©¡£ÐÐÊÇͨ¹ýµ÷ÓÃmysql_fetch_row()»ñµÃµÄ¡£
 MYSQL_FIELD
¸Ã½á¹¹°üº¬¹ØÓÚ×ֶεÄÐÅÏ¢£¬Èç×Ö¶ÎÃû¡¢ÀàÐͺʹóС¡£ÕâÀïÏêϸ½éÉÜÁËÆä³ÉÔ±¡£Í¨¹ýÖظ´µ÷ÓÃmysql_fetch_field()£¬¿ÉΪÿ¸ö×ֶλñµÃMYSQL_FIELD½á¹¹¡£×Ö¶ÎÖµ²»ÊǸýṹµÄ×é³É²¿·Ý£¬ËüÃÇ°üº¬ÔÚMYSQL_ROW½á¹¹ÖС£
 MYSQL_FIELD_OFFSET
ÕâÊÇMySQL×Ö¶ÎÁбíÆ«ÒÆÁ¿µÄ“ÀàÐÍ°²È«”±íʾ£¨ÓÉmysql_field_seek()ʹÓã©¡£Æ«ÒÆÁ¿ÊÇÐÐÄÚµÄ×ֶαàºÅ£¬´Ó0¿ªÊ¼¡£
 my_ulonglong
ÓÃÓÚÐÐÊýÒÔ¼°mysql_affected_rows()¡¢mysql_num_rows()ºÍmysql_insert_id()µÄÀàÐÍ¡£¸ÃÀàÐÍÌṩµÄ·¶Î§Îª0¡«1.84e19¡£
ÔÚijЩϵͳÉÏ£¬²»ÄÜ´òÓ¡ÀàÐÍmy_ulonglongµÄÖµ¡£ÒªÏë´òÓ¡ÕâÀàÖµ£¬Ç뽫Æäת»»ÎªÎÞ·ûºÅ³¤ÕûÊýÀàÐͲ¢Ê¹ÓÃ%lu´òÓ¡¸ñʽ£¬ÀýÈ磺
printf ("Number of rows: %lu\n", (unsigned long) mysql_num_rows(result));


Ïà¹ØÎĵµ£º

ÔÚC#.net³ÌÐòÖÐʹÓÃMYSQLÊý¾Ý¿â

ÏÂÃæÊÇcommond:
MySQLCommand cmd;
cmd = new MySQLDriverCS.MySQLCommand("DROP TABLE IF EXISTS test.mysqldrivercs_test",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
ÏÂÃæÊÇinsert:
string Value = "Value";
int SettingID = 1;
new MySQLInsertCommand(conn,
new object[,] {{"SettingID",SettingID},{"S ......

Á˽âMySQlÊý¾Ý¿âĿ¼

Êý¾Ý¿âĿ¼ÊÇMySQLÊý¾Ý¿â·þÎñÆ÷´æ·ÅÊý¾ÝÎļþµÄµØ·½£¬²»½ö°üÀ¨ÓйرíµÄÎļþ£¬»¹°üÀ¨Êý¾ÝÎļþºÍMySQLµÄ·þÎñÆ÷Ñ¡ÏîÎļþ¡£²»Í¬µÄ·Ö·¢£¬Êý¾Ý¿âĿ¼µÄȱʡλÖÃÊDz»Í¬µÄ¡£
Êý¾ÝĿ¼µÄλÖÃ
ȱʡµÄÊý¾Ý¿âλÖÃ
ȱʡÊý¾Ý¿âµÄλÖñàÒëÔÚ·þÎñÆ÷ÖС£
¡ôÈç¹ûÄúÊÇÔÚÒ»¸öÔ´³ÌÐò·Ö·¢°üÖа²×° MySQL£¬µäÐ͵ÄȱʡλÖÿÉÄÜÊÇ /usr/local/var ......

MYSQLË÷ÒýµÄʹÓÃ

ÔÚÊý¾Ý¿â±íÖУ¬¶Ô×ֶν¨Á¢Ë÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËٶȡ£¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö
mytable
񡜧
CREATE TABLE mytable(
ID INT NOT NULL,
username VARCHAR(16) NOT NULL
);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË
10000
Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ£º
5555, admin
¡£
ÔÚ²éÕÒ
username="admin"
µÄ¼Ç¼
SELECT * from mytable WH ......

mysql load data infile

ÈçºÎÌá¸ßmysql load
data
infile
µÄËÙ¶È
²âÊÔÊý¾Ý2.5G£¬¹²ÓÐÊý¾Ý9427567Ìõ¡£ÓõÄmysqlµÄlarge·þÎñÆ÷µÄÅäÖá£
load
Ò»´ÎÐèÒª´ó¸Å10·ÖÖÓ×óÓÒ¡£
½¨µÄ±íÓõÄÊÇMYISAM£¬µ÷ÕûÁ˼¸¸ösessionµÄ²ÎÊýÖµ
SET SESSION BULK_INSERT_BUFFER_SIZE=256217728;
SET SESSION MYISAM_SORT_BUFFER_SIZE=256217728;
ÔËÐнá¹ûÈçÏÂ
Qu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ