Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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));


Ïà¹ØÎĵµ£º

mysql×Ö·û¼¯²é¿´ÒÔ¼°ÐÞ¸Ä

ת×Ô:http://blog.chinaunix.net/u2/85344/showart_2042280.html
LiunxÏÂÐÞ¸ÄMySQL×Ö·û¼¯£º
1.²éÕÒMySQLµÄcnfÎļþµÄλÖÃ
find / -iname '*.cnf' -print

/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-large.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql ......

mysql×Ö·û¼¯Ð£Ñé¹æÔò

                                                   ......

MYSQL Êֲ᡾ժ¡¿

 20 MySQL¿Í»§¹¤¾ßºÍAPI
20.1 MySQL C API
C API´úÂëÊÇËæMySQL·Ö·¢µÄ£¬Ëü±»°üº¬ÔÚmysqlclient¿âÇÒÔÊÐíC³ÌÐò´æÈ¡Ò»¸öÊý¾Ý¿â¡£
ÔÚ MySQLÔ´´úÂë·Ö·¢Öеĺܶà¿Í»§ÊÇÓÃC±àдµÄ¡£Èç¹ûÄãÕýÔÚÑ°ÕÒÑÝʾÔõÑùʹÓÃC APIµÄÀý×Ó£¬¿´Ò»ÏÂÕâЩ¿Í»§³ÌÐò¡£
´ó¶àÊýÆäËû¿Í»§ API(³ýÁËJavaµÄËùÓÐ)¶¼Ê¹ÓÃmysqlclient¿âÓëMySQL·þÎñÆ÷ͨÐÅ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ